-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from santinoncs/upgrade_kubewatch
upgrade client-go libraries and modify the golang build method
- Loading branch information
Showing
5 changed files
with
336 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,23 @@ | ||
#------------------------------------------------------------------------------ | ||
# Set the base image for subsequent instructions: | ||
#------------------------------------------------------------------------------ | ||
FROM golang:1.12-stretch AS build | ||
|
||
FROM alpine:3.5 | ||
MAINTAINER Marc Villacorta Morera <marc.villacorta@gmail.com> | ||
ENV GO111MODULE=on | ||
|
||
#------------------------------------------------------------------------------ | ||
# Environment variables: | ||
#------------------------------------------------------------------------------ | ||
RUN mkdir /kubewatch | ||
WORKDIR /kubewatch | ||
COPY go.mod . | ||
COPY go.sum . | ||
|
||
ENV GOPATH="/go" | ||
# Get dependancies - will also be cached if we won't change mod/sum | ||
RUN go mod download | ||
# COPY the source code as the last step | ||
COPY . . | ||
|
||
#------------------------------------------------------------------------------ | ||
# Build and install: | ||
#------------------------------------------------------------------------------ | ||
# Build the binary | ||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o /usr/local/bin/kubewatch | ||
|
||
RUN apk add -U --no-cache -t dev git go musl-dev \ | ||
&& go get github.com/softonic/kubewatch \ | ||
&& cp ${GOPATH}/bin/kubewatch /usr/local/bin \ | ||
&& apk del --purge dev && rm -rf /tmp/* /go | ||
|
||
#------------------------------------------------------------------------------ | ||
# Entrypoint: | ||
#------------------------------------------------------------------------------ | ||
|
||
ENTRYPOINT [ "kubewatch" ] | ||
FROM debian:stretch-slim | ||
COPY --from=build /usr/local/bin/kubewatch /usr/local/bin/kubewatch | ||
|
||
ENTRYPOINT ["kubewatch"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module github.com/softonic/kubewatch | ||
|
||
go 1.12 | ||
|
||
require ( | ||
github.com/Azure/go-autorest/autorest v0.2.0 // indirect | ||
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef // indirect | ||
github.com/google/btree v1.0.0 // indirect | ||
github.com/google/gofuzz v1.0.0 // indirect | ||
github.com/googleapis/gnostic v0.2.0 // indirect | ||
github.com/gophercloud/gophercloud v0.1.0 // indirect | ||
github.com/gregjones/httpcache v0.0.0-20190212212710-3befbb6ad0cc // indirect | ||
github.com/imdario/mergo v0.3.7 // indirect | ||
github.com/json-iterator/go v1.1.6 // indirect | ||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | ||
github.com/modern-go/reflect2 v1.0.1 // indirect | ||
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect | ||
github.com/sirupsen/logrus v1.4.2 | ||
github.com/spf13/pflag v1.0.3 // indirect | ||
github.com/stretchr/testify v1.3.0 // indirect | ||
golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5 // indirect | ||
golang.org/x/oauth2 v0.0.0-20190523182746-aaccbc9213b0 // indirect | ||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect | ||
gopkg.in/alecthomas/kingpin.v2 v2.2.6 | ||
gopkg.in/inf.v0 v0.9.1 // indirect | ||
k8s.io/api v0.0.0-20190111032252-67edc246be36 | ||
k8s.io/apimachinery v0.0.0-20181127025237-2b1284ed4c93 | ||
k8s.io/client-go v10.0.0+incompatible | ||
k8s.io/klog v0.3.2 // indirect | ||
sigs.k8s.io/yaml v1.1.0 // indirect | ||
) |
Oops, something went wrong.