Skip to content

Commit

Permalink
remove arm platform
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredLunde committed Dec 29, 2024
1 parent 7229f9a commit e154b1f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 23 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
with:
Expand Down Expand Up @@ -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
26 changes: 6 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 \
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e154b1f

Please sign in to comment.