1

I try to make autobuild on Docker Hub from my repo on Github for two platforms (linux/arm64 and linux/amd64).

I figured out, that I need directory hooks with file build, where I can overwrite default build command. I create this content:

#!/bin/bash

export DOCKER_CLI_EXPERIMENTAL=enabled

docker buildx create --use --driver docker-container
docker buildx build --platform linux/amd64,linux/arm64 -f $DOCKERFILE_PATH -t $IMAGE_NAME . --push

And it generate only image linux/amd64. My guest is some problems occurred during build (which has status 'success'):

#11 [linux/arm64 3/3] RUN echo "https://dl-cdn.alpinelinux.org/alpine/edge/t...
#11 0.424 fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/aarch64/APKINDEX.tar.gz
#11 1.382 fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/aarch64/APKINDEX.tar.gz
#11 2.204 fetch https://dl-cdn.alpinelinux.org/alpine/edge/testing/aarch64/APKINDEX.tar.gz
#11 3.326 v3.12.3-12-g15f1da04e4 [http://dl-cdn.alpinelinux.org/alpine/v3.12/main]
#11 3.326 v3.12.3-12-g15f1da04e4 [http://dl-cdn.alpinelinux.org/alpine/v3.12/community]
#11 3.326 v20200917-5516-ge059564c29 [https://dl-cdn.alpinelinux.org/alpine/edge/testing]
#11 3.327 OK: 16528 distinct packages available
#11 3.559 fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/aarch64/APKINDEX.tar.gz
#11 3.881 fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/aarch64/APKINDEX.tar.gz
#11 4.376 fetch https://dl-cdn.alpinelinux.org/alpine/edge/testing/aarch64/APKINDEX.tar.gz
#11 5.365 (1/19) Installing pcre (8.44-r0)
#11 5.606 (2/19) Installing grep (3.4-r0)
#11 5.621 (3/19) Installing libmnl (1.0.4-r0)
#11 5.627 (4/19) Installing libnftnl-libs (1.1.6-r0)
#11 5.784 (5/19) Installing iptables (1.8.4-r2)
#11 5.855 (6/19) Installing ppp-chat (2.4.8-r2)
#11 5.868 (7/19) Installing ppp-daemon (2.4.8-r2)
#11 5.901 (8/19) Installing ppp-radius (2.4.8-r2)
#11 5.918 (9/19) Installing ppp-atm (2.4.8-r2)
#11 5.930 (10/19) Installing ppp-pppoe (2.4.8-r2)
#11 5.943 (11/19) Installing ppp-l2tp (2.4.8-r2)
#11 5.956 (12/19) Installing ppp-winbind (2.4.8-r2)
#11 5.968 (13/19) Installing ppp-passprompt (2.4.8-r2)
#11 5.981 (14/19) Installing ppp-passwordfd (2.4.8-r2)
#11 5.993 (15/19) Installing ppp-minconn (2.4.8-r2)
#11 6.004 (16/19) Installing ppp (2.4.8-r2)
#11 6.016 (17/19) Installing openfortivpn (1.15.0-r0)
#11 6.162 (18/19) Installing openssl (1.1.1i-r0)
#11 6.190 (19/19) Installing sed (4.8-r0)
#11 6.210 Executing busybox-1.31.1-r19.trigger
#11 6.214 ERROR: busybox-1.31.1-r19.trigger: script exited with error 1    <=== here is some error
#11 6.224 OK: 10 MiB in 33 packages
#11 DONE 6.5s

If I make the same command on my PC (Windows 10, Docker version 20.10.0, build 7287ab3) I have no errors.

I changed build file for use default driver (docker) and build only for linux/arm64:

#!/bin/bash

export DOCKER_CLI_EXPERIMENTAL=enabled

docker buildx create --use
docker buildx build --platform linux/arm64 -f $DOCKERFILE_PATH -t $IMAGE_NAME . --push

And I have the same error, build shown as 'success' and new image pushed to Docker Hub (new digest) but os/arch is... linux/amd64, not linux/arm64. Why?

My goal is to build both linux/amd64 and linux/arm64 with autobuilds from Docker Hub.

Docker page: https://hub.docker.com/repository/docker/netrunn3r/vpn-gateway
Github page: https://github.com/netrunn3r/vpn-gateway

1
  • Maybe this answer might help you out... I've already save those commands as an alias... Time to time my muiltarch build breaks, I think this due to me cleaning my Images, Containers and Layers cache or probably some Docker related update in my host machine; those commands always saves my day Mar 20 at 20:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.