Skip to content

Commit

Permalink
simplify docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
Hermsi1337 committed Mar 29, 2019
1 parent c00e699 commit e41aced
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
11 changes: 6 additions & 5 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ changelog:
dockers:
-
image_templates:
- quay.io/mittwald/kubernetes-secret-generator:latest
- quay.io/mittwald/kubernetes-secret-generator:stable
- quay.io/mittwald/kubernetes-secret-generator:{{ .Tag }}
- quay.io/mittwald/kubernetes-secret-generator:{{ .Tag }}-{{ .Env.GO_VERSION }}
extra_files:
- util/copy_secret.go
- main.go
- go.mod
- go.sum
binaries:
- kubernetes-secret-generator
goos: linux
goarch: amd64
goarm: ''
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ before_deploy:
deploy:
- provider: script
skip_cleanup: true
script: docker build -t "${FULL_IMAGE}:latest" && docker push "${FULL_IMAGE}:latest"
script: bash <(wget -qO- https://git.io/goreleaser) --snapshot --skip-publish --rm-dist && docker push "${FULL_IMAGE}:latest"
on:
tags: false
branch: master
Expand Down
7 changes: 1 addition & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
FROM golang:1.12
WORKDIR /src
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o kubernetes-secret-generator

FROM scratch
LABEL MAINTAINER="Martin Helmich <[email protected]>"
COPY --from=0 /src/kubernetes-secret-generator /kubernetes-secret-generator
COPY kubernetes-secret-generator /kubernetes-secret-generator
ENTRYPOINT ["/kubernetes-secret-generator"]
CMD ["-logtostderr"]

0 comments on commit e41aced

Please sign in to comment.