diff --git a/1.21/alpine3.18/Dockerfile b/1.21/alpine3.18/Dockerfile index c08d2ddd..3f3d9f4f 100644 --- a/1.21/alpine3.18/Dockerfile +++ b/1.21/alpine3.18/Dockerfile @@ -112,6 +112,15 @@ RUN set -eux; \ /usr/local/go/src/cmd/dist/dist \ "$GOCACHE" \ ; \ + elif [ "$arch" = 'armv7' ]; then \ + [ -s /usr/local/go/go.env ]; \ + before="$(go env GOARM)"; [ "$before" != '7' ]; \ + { \ + echo; \ + echo '# https://github.com/docker-library/golang/issues/494'; \ + echo 'GOARM=7'; \ + } >> /usr/local/go/go.env; \ + after="$(go env GOARM)"; [ "$after" = '7' ]; \ fi; \ \ apk del --no-network .fetch-deps; \ diff --git a/1.21/alpine3.19/Dockerfile b/1.21/alpine3.19/Dockerfile index 905b3d4e..44b083f7 100644 --- a/1.21/alpine3.19/Dockerfile +++ b/1.21/alpine3.19/Dockerfile @@ -112,6 +112,15 @@ RUN set -eux; \ /usr/local/go/src/cmd/dist/dist \ "$GOCACHE" \ ; \ + elif [ "$arch" = 'armv7' ]; then \ + [ -s /usr/local/go/go.env ]; \ + before="$(go env GOARM)"; [ "$before" != '7' ]; \ + { \ + echo; \ + echo '# https://github.com/docker-library/golang/issues/494'; \ + echo 'GOARM=7'; \ + } >> /usr/local/go/go.env; \ + after="$(go env GOARM)"; [ "$after" = '7' ]; \ fi; \ \ apk del --no-network .fetch-deps; \ diff --git a/1.21/bookworm/Dockerfile b/1.21/bookworm/Dockerfile index 102e1c6a..def7f931 100644 --- a/1.21/bookworm/Dockerfile +++ b/1.21/bookworm/Dockerfile @@ -120,6 +120,15 @@ RUN set -eux; \ /usr/local/go/src/cmd/dist/dist \ "$GOCACHE" \ ; \ + elif [ "$arch" = 'armhf' ]; then \ + [ -s /usr/local/go/go.env ]; \ + before="$(go env GOARM)"; [ "$before" != '7' ]; \ + { \ + echo; \ + echo '# https://github.com/docker-library/golang/issues/494'; \ + echo 'GOARM=7'; \ + } >> /usr/local/go/go.env; \ + after="$(go env GOARM)"; [ "$after" = '7' ]; \ fi; \ \ go version diff --git a/1.21/bullseye/Dockerfile b/1.21/bullseye/Dockerfile index 9ad380f7..0b1349c6 100644 --- a/1.21/bullseye/Dockerfile +++ b/1.21/bullseye/Dockerfile @@ -126,6 +126,15 @@ RUN set -eux; \ /usr/local/go/src/cmd/dist/dist \ "$GOCACHE" \ ; \ + elif [ "$arch" = 'armhf' ]; then \ + [ -s /usr/local/go/go.env ]; \ + before="$(go env GOARM)"; [ "$before" != '7' ]; \ + { \ + echo; \ + echo '# https://github.com/docker-library/golang/issues/494'; \ + echo 'GOARM=7'; \ + } >> /usr/local/go/go.env; \ + after="$(go env GOARM)"; [ "$after" = '7' ]; \ fi; \ \ go version diff --git a/Dockerfile-linux.template b/Dockerfile-linux.template index 1f207db5..19246b31 100644 --- a/Dockerfile-linux.template +++ b/Dockerfile-linux.template @@ -193,6 +193,17 @@ RUN set -eux; \ /usr/local/go/src/cmd/dist/dist \ "$GOCACHE" \ ; \ +{{ if [ "1.20" ] | index(env.version) then "" elif .arches["arm32v7"].url // "" | contains("armv6") then ( -}} + elif [ "$arch" = {{ os_arches["arm32v7"] | @sh }} ]; then \ + [ -s /usr/local/go/go.env ]; \ + before="$(go env GOARM)"; [ "$before" != {{ .arches["arm32v7"].env["GOARM"] | @sh }} ]; \ + { \ + echo; \ + echo '# https://github.com/docker-library/golang/issues/494'; \ + echo {{ "GOARM=\(.arches["arm32v7"].env["GOARM"])" | @sh }}; \ + } >> /usr/local/go/go.env; \ + after="$(go env GOARM)"; [ "$after" = {{ .arches["arm32v7"].env["GOARM"] | @sh }} ]; \ +{{ ) else "" end -}} fi; \ \ {{ if is_alpine then ( -}}