Skip to content

Commit

Permalink
Merge pull request #2 from patoarvizu/add_docker_labels
Browse files Browse the repository at this point in the history
Add docker labels
  • Loading branch information
patoarvizu committed Dec 8, 2019
2 parents e291d15 + 5f85567 commit c1201e3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ jobs:
notary -s https://notary.docker.io -d ~/.docker/trust key import ${HOME}/vault-agent-auto-inject-webhook-circleci.key --role vault-agent-auto-inject-webhook-circleci
export DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE=$NOTARY_DELEGATION_PASSPHRASE
go mod vendor
docker build -t patoarvizu/vault-agent-auto-inject-webhook:$CIRCLE_SHA1 .
DOCKER_BUILD_ARGS="--build-arg GIT_COMMIT=$CIRCLE_SHA1 --build-arg GIT_TAG=$CIRCLE_TAG --build-arg COMMIT_TIMESTAMP=$(git log -1 --format=%at) --build-arg AUTHOR_EMAIL=$(git log -1 --format=%ae) --build-arg SIGNATURE_KEY=$(git log -1 --format=%GK)"
docker build $DOCKER_BUILD_ARGS -t patoarvizu/vault-agent-auto-inject-webhook:$CIRCLE_SHA1 .
export DOCKER_CONTENT_TRUST=1
VERSION=${CIRCLE_TAG:-latest}
docker tag patoarvizu/vault-agent-auto-inject-webhook:$CIRCLE_SHA1 patoarvizu/vault-agent-auto-inject-webhook:latest
Expand All @@ -54,7 +55,7 @@ jobs:

workflows:
version: 2
build-operator:
build-webhook:
jobs:
- build:
filters:
Expand Down
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /vault-agent-auto-inject-w

FROM alpine:3.9

ARG GIT_COMMIT="unspecified"
LABEL GIT_COMMIT=$GIT_COMMIT

ARG GIT_TAG=""
LABEL GIT_TAG=$GIT_TAG

ARG COMMIT_TIMESTAMP="unspecified"
LABEL COMMIT_TIMESTAMP=$COMMIT_TIMESTAMP

ARG AUTHOR_EMAIL="unspecified"
LABEL AUTHOR_EMAIL=$AUTHOR_EMAIL

ARG SIGNATURE_KEY="undefined"
LABEL SIGNATURE_KEY=$SIGNATURE_KEY

RUN apk update && apk add ca-certificates

COPY --from=builder /vault-agent-auto-inject-webhook /
Expand Down

0 comments on commit c1201e3

Please sign in to comment.