Skip to content

Commit

Permalink
use targetplatform varible
Browse files Browse the repository at this point in the history
  • Loading branch information
SHildebrandt committed May 24, 2024
1 parent a6748f1 commit 4957284
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
17 changes: 4 additions & 13 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,12 @@ jobs:
run: |
go install github.com/swaggo/swag/cmd/swag@latest
swag init
env GOOS=linux GOARCH=amd64 go build -ldflags "-w -s" -o logicng-service-linux-amd64 main.go
env GOOS=linux GOARCH=arm64 go build -ldflags "-w -s" -o logicng-service-linux-arm64 main.go
- name: Build and Push ARM64 Image
env GOOS=linux GOARCH=amd64 go build -ldflags "-w -s" -o build/linux/amd64/logicng-service main.go
env GOOS=linux GOARCH=arm64 go build -ldflags "-w -s" -o build/linux/arm64/logicng-service main.go
- name: Build and Push Images
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ghcr.io/booleworks/logicng-service-test:${{ ENV.TAG_NAME }}
platforms: linux/arm64
build-args: PLATFORM=linux-arm64
- name: Build and Push AMD64 Image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ghcr.io/booleworks/logicng-service-test:${{ ENV.TAG_NAME }}
platforms: linux/amd64
build-args: PLATFORM=linux-amd64
platforms: linux/arm64,linux/amd64
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ LABEL org.opencontainers.image.source=https://github.com/booleworks/logicng-serv

ENV TIMEOUT 5s

ARG PLATFORM
COPY logicng-service-${PLATFORM} /opt/logicng-service
ARG TARGETPLATFORM

COPY build/$TARGETPLATFORM/logicng-service /opt/logicng-service

EXPOSE 8080
CMD /opt/logicng-service --timeout $TIMEOUT

0 comments on commit 4957284

Please sign in to comment.