Skip to content

Commit

Permalink
try again
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredLunde committed Dec 29, 2024
1 parent 81b8372 commit 4eaf115
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ jobs:
uses: docker/setup-qemu-action@v3
- name: Setup Docker buildx
uses: docker/[email protected]
with:
driver: docker-container
driver-opts: |
image=moby/buildkit:v0.12.4
network=host
- name: Log into registry
uses: docker/[email protected]
with:
Expand All @@ -42,6 +47,9 @@ jobs:
with:
context: .
push: true
build-args: |
TARGETOS=linux
TARGETARCH=${{ matrix.platform }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
Expand Down
15 changes: 2 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
FROM base AS deps
WORKDIR /go/src/app
COPY go.mod* go.sum* ./
RUN go mod download && go mod tidy
RUN go mod download && go mod verify

FROM deps AS vips-builder
ARG VIPS_VERSION=8.16.0
Expand Down Expand Up @@ -55,18 +55,7 @@ WORKDIR /go/src/app
ARG TARGETOS
ARG TARGETARCH
COPY . .
RUN echo "Building for OS: $TARGETOS, ARCH: $TARGETARCH" && \
if [ "$TARGETARCH" = "arm64" ]; then \
echo "Setting ARM64 specific flags" && \
GOARCH=arm64 GOOS=linux \
CGO_ENABLED=1 CGO_CFLAGS_ALLOW=-Xpreprocessor \
CC="gcc -march=armv8-a" \
go build -trimpath -ldflags="-s -w" -o /go/bin/app ./cmd/server; \
else \
echo "Building for AMD64" && \
CGO_ENABLED=1 \
go build -trimpath -ldflags="-s -w" -o /go/bin/app ./cmd/server; \
fi
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} CGO_ENABLED=1 CC=${CC:-gcc} go build -trimpath -ldflags="-s -w" -o /go/bin/app ./cmd/server

FROM debian:stable-slim
WORKDIR /app
Expand Down

0 comments on commit 4eaf115

Please sign in to comment.