mirror of
https://github.com/watn3y/steamsalty.git
synced 2025-04-19 16:01:22 +02:00
add cross-compile
This commit is contained in:
parent
453f03d832
commit
96db61831c
2 changed files with 8 additions and 8 deletions
5
.github/workflows/docker-on-push.yml
vendored
5
.github/workflows/docker-on-push.yml
vendored
|
@ -12,9 +12,6 @@ jobs:
|
|||
- name: Check out the repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
|
@ -29,7 +26,7 @@ jobs:
|
|||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
platforms: linux/amd64,linux/arm64
|
||||
platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7
|
||||
push: true
|
||||
tags: |
|
||||
ghcr.io/${{ github.repository }}:master
|
||||
|
|
11
Dockerfile
11
Dockerfile
|
@ -1,12 +1,15 @@
|
|||
FROM golang:alpine AS builder
|
||||
FROM --platform=$BUILDPLATFORM golang:1.23.4-alpine AS builder
|
||||
|
||||
WORKDIR /steamsalty
|
||||
|
||||
RUN apk update && apk add --no-cache ca-certificates
|
||||
|
||||
COPY . .
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
RUN go build -o /app/steamsalty
|
||||
|
||||
COPY . .
|
||||
ARG TARGETOS TARGETARCH
|
||||
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /app/steamsalty
|
||||
|
||||
|
||||
|
||||
|
@ -18,4 +21,4 @@ COPY --from=builder /usr/share/ca-certificates /usr/share/ca-certificates
|
|||
|
||||
COPY --from=builder /app/steamsalty /app/steamsalty
|
||||
|
||||
ENTRYPOINT ["/app/steamsalty"]
|
||||
ENTRYPOINT ["/app/steamsalty"]
|
||||
|
|
Loading…
Reference in a new issue