Browse Source

Remove multi-arch hack for Go in Dockerfile; Add --load to buildx build

DarthSim 8 months ago
parent
commit
c630ddd309
2 changed files with 2 additions and 7 deletions
  1. 2 0
      cloudbuild.yaml
  2. 0 7
      docker/Dockerfile

+ 2 - 0
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'

+ 0 - 7
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