Skip to content

Commit

Permalink
Set kpt version for binary built with docker
Browse files Browse the repository at this point in the history
  • Loading branch information
mortent committed Jul 11, 2020
1 parent c90409f commit c87afd6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ FROM golang:1.13-stretch
ENV CGO_ENABLED=0
ENV GO111MODULE=on

ARG KPT_VERSION=unknown

WORKDIR /go/src/
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN go build -v -o /usr/local/bin/kpt ./
RUN go build -v -o /usr/local/bin/kpt -ldflags="-s -w -X github.com/GoogleContainerTools/kpt/run.version=$KPT_VERSION" ./

FROM alpine:3.11
RUN apk update && apk upgrade && \
Expand Down
2 changes: 1 addition & 1 deletion release/tag/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ steps:
# build docker image
- name: 'gcr.io/cloud-builders/docker'
dir: 'kpt'
args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/kpt:${TAG_NAME}', '.' ]
args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/kpt:${TAG_NAME}', '.', '--build-arg', 'KPT_VERSION=${_VERSION}']

- name: 'gcr.io/cloud-builders/docker'
dir: 'kpt'
Expand Down

0 comments on commit c87afd6

Please sign in to comment.