mirror of
https://github.com/gravitl/netmaker.git
synced 2024-11-10 09:32:32 +08:00
embedd version info into docker image binary
This commit is contained in:
parent
4e8bf0c763
commit
6cd0858556
2 changed files with 5 additions and 3 deletions
3
.github/workflows/publish-docker.yml
vendored
3
.github/workflows/publish-docker.yml
vendored
|
@ -47,6 +47,7 @@ jobs:
|
|||
load: true
|
||||
platforms: linux/amd64
|
||||
tags: ${{ env.TAG }}
|
||||
build-args: version=${{ env.TAG }}
|
||||
-
|
||||
name: Test x86
|
||||
run: |
|
||||
|
@ -61,6 +62,7 @@ jobs:
|
|||
load: true
|
||||
platforms: linux/arm64
|
||||
tags: ${{ env.TAG }}
|
||||
build-args: version=${{ env.TAG }}
|
||||
-
|
||||
name: Test arm
|
||||
run: |
|
||||
|
@ -75,3 +77,4 @@ jobs:
|
|||
platforms: linux/amd64, linux/arm64
|
||||
push: true
|
||||
tags: ${{ github.repository }}:${{ env.TAG }}
|
||||
build-args: version=${{ env.TAG }}
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
#first stage - builder
|
||||
FROM golang:1.17-alpine as builder
|
||||
ARG version
|
||||
ARG VERSION
|
||||
RUN apk add build-base
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
ENV GO111MODULE=auto
|
||||
|
||||
# RUN GOOS=linux CGO_ENABLED=1 go build -tags debug -ldflags="-s -X 'main.version=$version'" -o netmaker main.go
|
||||
RUN GOOS=linux CGO_ENABLED=1 go build -ldflags="-s -X 'main.version=$VERSION'" -o netmaker main.go
|
||||
RUN GOOS=linux CGO_ENABLED=1 go build -ldflags="-s -X 'main.version=${VERSION}'" -o netmaker main.go
|
||||
FROM alpine:3.14.3
|
||||
|
||||
# add a c lib
|
||||
|
|
Loading…
Reference in a new issue