From e154b1fcb728da13d740c82e5332ced868d049d8 Mon Sep 17 00:00:00 2001 From: Jared Lunde Date: Sun, 29 Dec 2024 12:36:53 -0800 Subject: [PATCH] remove arm platform --- .github/workflows/release.yml | 4 +--- Dockerfile | 26 ++++++-------------------- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cce2e61..20e5d62 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,8 +17,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Set up QEMU # Add this step - uses: docker/setup-qemu-action@v3 - name: Setup Docker buildx uses: docker/setup-buildx-action@v3.3.0 with: @@ -52,6 +50,6 @@ jobs: TARGETARCH=${{ matrix.platform }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 cache-from: type=gha cache-to: type=gha,mode=max diff --git a/Dockerfile b/Dockerfile index e214033..7155d34 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ # syntax=docker/dockerfile:1 ARG VERSION=1.23.1 +ARG BUILDPLATFORM=linux/amd64 ARG BUILDER=docker.io/library/golang FROM --platform=${BUILDPLATFORM} ${BUILDER}:${VERSION} AS base @@ -8,22 +9,16 @@ 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 verify +RUN go mod download && go mod tidy FROM deps AS vips-builder ARG VIPS_VERSION=8.16.0 -ARG TARGETOS -ARG TARGETARCH ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig -RUN if [ "${TARGETARCH}" = "arm64" ]; then \ - dpkg --add-architecture arm64; \ - fi RUN DEBIAN_FRONTEND=noninteractive \ apt-get update && \ apt-get install --no-install-recommends -y \ ca-certificates automake build-essential curl \ - $([ "${TARGETARCH}" = "arm64" ] && echo "gcc-aarch64-linux-gnu") \ meson ninja-build pkg-config \ gobject-introspection gtk-doc-tools libglib2.0-dev \ libjpeg62-turbo-dev libpng-dev libwebp-dev libtiff-dev \ @@ -56,20 +51,11 @@ RUN cd /tmp && \ FROM vips-builder AS build WORKDIR /go/src/app -ARG TARGETOS -ARG TARGETARCH +ARG TARGETOS=linux +ARG TARGETARCH=amd64 + COPY . . -ENV GOOS=${TARGETOS} -ENV GOARCH=${TARGETARCH} -ENV CGO_ENABLED=1 -RUN if [ "${TARGETARCH}" = "arm64" ]; then \ - apt-get update && \ - apt-get install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross && \ - export CC=aarch64-linux-gnu-gcc; \ - export CXX=aarch64-linux-gnu-g++; \ - export CROSS_COMPILE=aarch64-linux-gnu-; \ - fi -RUN go build -trimpath -ldflags="-s -w" -o /go/bin/app ./cmd/server +RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -trimpath -ldflags="-s -w" -o /go/bin/app ./cmd/server FROM debian:stable-slim WORKDIR /app