Skip to content

Commit

Permalink
fix docker image inner version
Browse files Browse the repository at this point in the history
  • Loading branch information
nektro committed Aug 8, 2021
1 parent fcc4f08 commit b4d4beb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ jobs:
- run: go version
- run: go env
- run: go get -v .
- run: go test -v .
- run: ./scripts/build_all.sh
- store_artifacts:
path: ./bin/
Expand All @@ -25,6 +24,7 @@ jobs:
- docker/build:
image: $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME
tag: latest,v$CIRCLE_BUILD_NUM
extra_build_args: --build-arg VERSION=v$CIRCLE_BUILD_NUM
- docker/push:
image: $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME
tag: latest,v$CIRCLE_BUILD_NUM
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
FROM golang:alpine as golang
WORKDIR /app
COPY . .
ARG VERSION
RUN apk add --no-cache git gcc musl-dev \
&& export VCS_REF=$(git tag --points-at HEAD) \
&& echo $VCS_REF \
&& go install -v github.com/rakyll/statik \
&& $GOPATH/bin/statik -src="./www/" \
&& go get -v . \
&& CGO_ENABLED=1 go build -ldflags "-s -w -X main.Version=$VCS_REF" .
&& CGO_ENABLED=1 go build -ldflags "-s -w -X main.Version=$VERSION" .

FROM alpine
COPY --from=golang /app/andesite /app/andesite
Expand Down

0 comments on commit b4d4beb

Please sign in to comment.