Browse Source

Merge pull request #1852 from gravitl/hotfix_docker_workflow2

Hotfix docker workflow2
Matthew R Kasun 2 years ago
parent
commit
9c54a54fb0
2 changed files with 9 additions and 5 deletions
  1. 8 4
      .github/workflows/publish-docker.yml
  2. 1 1
      Dockerfile

+ 8 - 4
.github/workflows/publish-docker.yml

@@ -47,7 +47,9 @@ jobs:
           platforms: linux/amd64, linux/arm64, linux/arm/v7
           push: true
           tags: ${{ github.repository }}:${{ env.TAG }}, ${{ github.repository }}:latest
-          build-args: version=${{ env.TAG }}, tags="-tags=ce"
+          build-args: | 
+            version=${{ env.TAG }}
+            tags=ce
 
   docker-ee:
     runs-on: ubuntu-latest
@@ -56,7 +58,7 @@ jobs:
         name: Set tag
         run: |
             if [[ -n "${{ github.event.inputs.tag }}" ]]; then
-              docker/build-push-action@v3.tag }}
+              TAG=${{ github.event.inputs.tag }}
             elif [[ "${{ github.ref_name }}" == 'master' ]]; then
               TAG="latest"
             else
@@ -71,7 +73,7 @@ jobs:
         uses: docker/setup-qemu-action@v2
       - 
         name: Set up Docker Buildx
-        uses: docker/build-push-action@v3
+        uses: docker/setup-buildx-action@v2
       - 
         name: Login to DockerHub
         uses: docker/login-action@v2
@@ -86,4 +88,6 @@ jobs:
           platforms: linux/amd64, linux/arm64, linux/arm/v7
           push: true
           tags: ${{ github.repository }}:${{ env.TAG }}-ee
-          build-args: version=${{ env.TAG }}, tags="-tags=ee"
+          build-args: |
+            version=${{ env.TAG }}
+            tags=ee

+ 1 - 1
Dockerfile

@@ -7,7 +7,7 @@ COPY . .
 ENV GO111MODULE=auto
 
 RUN apk add git
-RUN GOOS=linux CGO_ENABLED=1 go build -ldflags="-s -X 'main.version=${version}'" ${tags} .
+RUN GOOS=linux CGO_ENABLED=1 go build -ldflags="-s -X 'main.version=${version}'" -tags ${tags} .
 # RUN go build -tags=ee . -o netmaker main.go
 FROM alpine:3.16.2