Browse Source

Fix Docker build

DarthSim 3 years ago
parent
commit
94b22a9679
2 changed files with 3 additions and 4 deletions
  1. 2 1
      docker/Dockerfile
  2. 1 3
      docker/fix-go.sh

+ 2 - 1
docker/Dockerfile

@@ -6,7 +6,8 @@ ARG BUILDPLATFORM
 ARG TARGETPLATFORM
 
 COPY . .
-RUN docker/go.sh build -v -ldflags "-s -w" -o /usr/local/bin/imgproxy
+RUN docker/fix-go.sh
+RUN go build -v -ldflags "-s -w" -o /usr/local/bin/imgproxy
 
 # ==================================================================================================
 # Final image

+ 1 - 3
docker/go.sh → docker/fix-go.sh

@@ -11,7 +11,7 @@ if [[ $BUILDPLATFORM != $TARGETPLATFORM ]]; then
       ;;
 
     arm64 | "arm64/v8" | "linux/arm64" | "linux/arm64/v8")
-      BUILDPLATFORM="arm64"
+      BUILD_ARCH="arm64"
       ;;
 
     *)
@@ -48,5 +48,3 @@ if [[ $BUILDPLATFORM != $TARGETPLATFORM ]]; then
   export GOOS=linux
   export GOARCH=$TARGET_ARCH
 fi
-
-go $@