From c630ddd3097779d1cb039e8c78cf19cf4e6e448c Mon Sep 17 00:00:00 2001 From: DarthSim Date: Tue, 22 Oct 2024 21:12:46 +0300 Subject: [PATCH] Remove multi-arch hack for Go in Dockerfile; Add --load to buildx build --- cloudbuild.yaml | 2 ++ docker/Dockerfile | 7 ------- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 8c309103..16091349 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -18,6 +18,7 @@ steps: args: - 'buildx' - 'build' + - '--load' - '-t' - 'darthsim/imgproxy:$TAG_NAME-amd64' - '-f' @@ -33,6 +34,7 @@ steps: args: - 'buildx' - 'build' + - '--load' - '-t' - 'darthsim/imgproxy:$TAG_NAME-amd64' - '-f' diff --git a/docker/Dockerfile b/docker/Dockerfile index d6d5347a..5e62d938 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,7 +1,5 @@ ARG BASE_IMAGE_VERSION="v3.11.0" -FROM --platform=${BUILDPLATFORM} darthsim/imgproxy-base:${BASE_IMAGE_VERSION} as base-native - FROM darthsim/imgproxy-base:${BASE_IMAGE_VERSION} as build ARG BUILDARCH @@ -11,11 +9,6 @@ RUN dpkg --add-architecture ${BUILDARCH} \ && apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libstdc++6:${BUILDARCH} -# This is pretty dirty hack. Building imgproxy under Qemu is pretty slow. -# So we install Go binary native for the BUILDARCH. -RUN rm -rf /usr/local/go -COPY --from=base-native /usr/local/go /usr/local/go - ENV CGO_ENABLED=1 ENV GOOS=linux ENV GOARCH=$TARGETARCH