Skip to content

Commit

Permalink
Docker add build args
Browse files Browse the repository at this point in the history
for target platform
  • Loading branch information
loan-mgt committed May 12, 2024
1 parent 1035ff8 commit f0eb085
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Start from the official golang image
FROM golang:1.22-alpine AS builder

ARG GOARCH

# Set necessary environment variables
ENV GO111MODULE=on \
CGO_ENABLED=0 \
GOOS=linux \
GOARCH=amd64
GOARCH=$GOARCH

# Move to working directory /build
WORKDIR /build
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ services:
build:
context: .
dockerfile: Dockerfile
args:
GOARCH: arm
ports:
- "8080:8080"

0 comments on commit f0eb085

Please sign in to comment.