File tree Expand file tree Collapse file tree 4 files changed +21
-12
lines changed Expand file tree Collapse file tree 4 files changed +21
-12
lines changed Original file line number Diff line number Diff line change 11.PHONY : all
22
33all : build test
4+ IMG ="sysdig/kube-psp-advisor"
5+ VERSION =$(shell cat version)
46
57test :
68 @echo " + $@ "
@@ -11,3 +13,11 @@ example:
1113build :
1214 @echo " + $@ "
1315 ./scripts/build
16+ build-image :
17+ @echo " + $@ "
18+ docker build -f container/Dockerfile -t ${IMG} :${VERSION} .
19+ push-image :
20+ @echo " + $@ "
21+ docker push ${IMG} :${VERSION}
22+ docker tag ${IMG} :${VERSION} ${IMG} :latest
23+ docker push ${IMG} :latest
Original file line number Diff line number Diff line change 1- FROM golang:1.12.9-alpine3.10
2- RUN apk add --no-cache git curl
1+ FROM golang:1.12.9-alpine3.10 AS builder
2+ RUN apk add --no-cache build-base git
33WORKDIR $GOPATH/src/kube-psp-advisor
4- COPY . .
5- # aws-iam-authenticator is optional, please install necessary k8s cloud authenticator accordingly
6- # RUN curl -o aws-iam-authenticator https://amazon-eks.s3-us-west-2.amazonaws.com/1.11.5/2018-12-06/bin/linux/amd64/aws-iam-authenticator
7- # RUN chmod u+x aws-iam-authenticator
8- # RUN mv aws-iam-authenticator /usr/local/bin
4+ COPY . $GOPATH/src/kube-psp-advisor
95ENV GO111MODULE=on
10- RUN go get -d -v ./...
11- RUN env GOOS=$(uname -s | tr '[:upper:]' '[:lower:]' ) GOARCH=amd64 CGO_ENABLED=0 go build -a
12- ENV PATH /go/src/kube-psp-advisor:$PATH
13- RUN apk del curl
6+ RUN go get golang.org/x/tools/cmd/goimports
7+ RUN make build
8+
9+ FROM alpine
10+ RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
11+ COPY --from=builder /go/src/kube-psp-advisor/kube-psp-advisor /kube-psp-advisor
1412
1513ENTRYPOINT ["kube-psp-advisor" ]
1614CMD ["inspect" ]
Original file line number Diff line number Diff line change 33set -eux
44
55export GO111MODULE=on
6- # dep ensure
6+
77$GOPATH /bin/goimports -w $( find . -type f -name ' *.go' -not -path " ./vendor/*" ) || true
88
99env GOOS=$( uname -s | tr ' [:upper:]' ' [:lower:]' ) GOARCH=amd64 go build -a
Original file line number Diff line number Diff line change 1+ 1.1.0
You can’t perform that action at this time.
0 commit comments