dockerarmdockerhub

Can I build arm32 docker files with dockerhub


I have DockerHub repository set up to autobuild my Dockerfile stored in a BitBucket repository. Every time a modification is made to the Dockerfile, and this works fine https://bitbucket.org/ijabz/songkongdocker/src/master/Dockerfile

I also have another Docker repository that points to a separate BitBucket repostitory https://bitbucket.org/ijabz/songkongdockerarm32/src/master/Dockerfile that builds an arm32 version of the application and I have been building this manually on an arm32 based qnap, but I have problems with my qnap so would like to be built on Dockerhub

I configured it but the build failed, its not clear to me if I have to do something special to build arm32 builds or if it is not possible

Dockerhub build fails as follows

....
    2024-06-18T11:35:16Z 
    2024-06-18T11:35:16Z #10 [build 2/4] RUN /opt/java/openjdk/bin/jlink --module-path=/opt/java/openjdk/jmods --add-modules java.desktop,java.datatransfer,java.logging,java.management,java.naming,java.net.http,java.prefs,java.scripting,java.sql,jdk.management,jdk.unsupported,jdk.jcmd,jdk.crypto.ec,jdk.dynalink --output /opt/songkong/jre
    2024-06-18T11:35:17Z #10 0.377 exec /bin/sh: exec format error
    2024-06-18T11:35:20Z #10 ERROR: executor failed running [/bin/sh -c /opt/java/openjdk/bin/jlink --module-path=/opt/java/openjdk/jmods --add-modules java.desktop,java.datatransfer,java.logging,java.management,java.naming,java.net.http,java.prefs,java.scripting,java.sql,jdk.management,jdk.unsupported,jdk.jcmd,jdk.crypto.ec,jdk.dynalink --output /opt/songkong/jre]: exit code: 1
    2024-06-18T11:35:20Z ------
    2024-06-18T11:35:20Z  > [build 2/4] RUN /opt/java/openjdk/bin/jlink --module-path=/opt/java/openjdk/jmods --add-modules java.desktop,java.datatransfer,java.logging,java.management,java.naming,java.net.http,java.prefs,java.scripting,java.sql,jdk.management,jdk.unsupported,jdk.jcmd,jdk.crypto.ec,jdk.dynalink --output /opt/songkong/jre:
    2024-06-18T11:35:20Z #10 0.377 exec /bin/sh: exec format error
    2024-06-18T11:35:20Z ------
    2024-06-18T11:35:20Z ERROR: failed to solve: executor failed running [/bin/sh -c /opt/java/openjdk/bin/jlink --module-path=/opt/java/openjdk/jmods --add-modules java.desktop,java.datatransfer,java.logging,java.management,java.naming,java.net.http,java.prefs,java.scripting,java.sql,jdk.management,jdk.unsupported,jdk.jcmd,jdk.crypto.ec,jdk.dynalink --output /opt/songkong/jre]: exit code: 1
    2024-06-18T11:35:20Z Build failed using Buildkit (1)

***Updated with attempt to use Zachs answer

Note I am just trying to build arm32 build not multibuild so I haven't created the post_push file within Bitbucket I just created hooks folder and build file containing

#!/bin/bash

# Set up buildx. Inspecting ensures buildx is configured correctly and ready, and the final command runs a container to set up QEMU, enabling the Arm emulation for cross-platform building.
docker buildx create --name mybuilder --use
docker buildx inspect --bootstrap
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

# Build & push the arm/v7 image
docker buildx build --platform linux/arm/v7 -t songkong/songkong-arm32:latest -f Dockerfile --push .

I replaced

-t username/repository:tag-arm32

with

-t songkong/songkong-arm32:latest

So songkong is my dockerhub username, songkong-arm32 is the dockerhub repository (dont confuse with bitbucket repository) and I always tag as latest

This triggers an automated build on DockerHub and this built okay using qemu, however failed at the last stage trying to push tag as follows

2024-07-03T19:44:28Z Cloning into '.'...
2024-07-03T19:44:29Z Warning: Permanently added the ECDSA host key for IP address '18.205.93.1' to the list of known hosts.
2024-07-03T19:44:30Z Reset branch 'master'
2024-07-03T19:44:30Z Your branch is up to date with 'origin/master'.
2024-07-03T19:44:30Z Executing build hook...
2024-07-03T19:44:39Z mybuilder
2024-07-03T19:44:39Z #1 [internal] booting buildkit
2024-07-03T19:44:39Z #1 pulling image moby/buildkit:buildx-stable-1
2024-07-03T19:44:47Z #1 pulling image moby/buildkit:buildx-stable-1 8.4s done
2024-07-03T19:44:47Z #1 creating container buildx_buildkit_mybuilder0
2024-07-03T19:44:51Z #1 creating container buildx_buildkit_mybuilder0 4.1s done
2024-07-03T19:44:51Z #1 DONE 12.5s
2024-07-03T19:44:51Z Name:          mybuilder
2024-07-03T19:44:51Z Driver:        docker-container
2024-07-03T19:44:51Z Last Activity: 2024-07-03 19:44:39 +0000 UTC
2024-07-03T19:44:51Z 
2024-07-03T19:44:51Z Nodes:
2024-07-03T19:44:51Z Name:      mybuilder0
2024-07-03T19:44:51Z Endpoint:  unix:///var/run/docker.sock
2024-07-03T19:44:51Z Status:    running
2024-07-03T19:44:51Z Buildkit:  v0.14.1
2024-07-03T19:44:51Z Platforms: linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/386
2024-07-03T19:44:51Z Unable to find image 'multiarch/qemu-user-static:latest' locally
2024-07-03T19:44:52Z latest: Pulling from multiarch/qemu-user-static
2024-07-03T19:44:52Z 205dae5015e7: Pulling fs layer
2024-07-03T19:44:52Z 816739e52091: Pulling fs layer
2024-07-03T19:44:52Z 30abb83a18eb: Pulling fs layer
2024-07-03T19:44:52Z 0657daef200b: Pulling fs layer
2024-07-03T19:44:52Z 30c9c93f40b9: Pulling fs layer
2024-07-03T19:44:52Z 0657daef200b: Waiting
2024-07-03T19:44:52Z 30c9c93f40b9: Waiting
2024-07-03T19:44:52Z 30abb83a18eb: Verifying Checksum
2024-07-03T19:44:52Z 30abb83a18eb: Download complete
2024-07-03T19:44:52Z 816739e52091: Verifying Checksum
2024-07-03T19:44:52Z 816739e52091: Download complete
2024-07-03T19:44:52Z 205dae5015e7: Verifying Checksum
2024-07-03T19:44:52Z 205dae5015e7: Download complete
2024-07-03T19:44:52Z 0657daef200b: Verifying Checksum
2024-07-03T19:44:52Z 0657daef200b: Download complete
2024-07-03T19:44:52Z 205dae5015e7: Pull complete
2024-07-03T19:44:53Z 816739e52091: Pull complete
2024-07-03T19:44:53Z 30abb83a18eb: Pull complete
2024-07-03T19:44:53Z 30c9c93f40b9: Verifying Checksum
2024-07-03T19:44:53Z 30c9c93f40b9: Download complete
2024-07-03T19:44:53Z 0657daef200b: Pull complete
2024-07-03T19:45:00Z 30c9c93f40b9: Pull complete
2024-07-03T19:45:00Z Digest: sha256:fe60359c92e86a43cc87b3d906006245f77bfc0565676b80004cc666e4feb9f0
2024-07-03T19:45:00Z Status: Downloaded newer image for multiarch/qemu-user-static:latest
2024-07-03T19:45:05Z Setting /usr/bin/qemu-alpha-static as binfmt interpreter for alpha
2024-07-03T19:45:05Z Setting /usr/bin/qemu-arm-static as binfmt interpreter for arm
2024-07-03T19:45:05Z Setting /usr/bin/qemu-armeb-static as binfmt interpreter for armeb
2024-07-03T19:45:05Z Setting /usr/bin/qemu-sparc-static as binfmt interpreter for sparc
2024-07-03T19:45:05Z Setting /usr/bin/qemu-sparc32plus-static as binfmt interpreter for sparc32plus
2024-07-03T19:45:05Z Setting /usr/bin/qemu-sparc64-static as binfmt interpreter for sparc64
2024-07-03T19:45:05Z Setting /usr/bin/qemu-ppc-static as binfmt interpreter for ppc
2024-07-03T19:45:05Z Setting /usr/bin/qemu-ppc64-static as binfmt interpreter for ppc64
2024-07-03T19:45:05Z Setting /usr/bin/qemu-ppc64le-static as binfmt interpreter for ppc64le
2024-07-03T19:45:05Z Setting /usr/bin/qemu-m68k-static as binfmt interpreter for m68k
2024-07-03T19:45:05Z Setting /usr/bin/qemu-mips-static as binfmt interpreter for mips
2024-07-03T19:45:05Z Setting /usr/bin/qemu-mipsel-static as binfmt interpreter for mipsel
2024-07-03T19:45:05Z Setting /usr/bin/qemu-mipsn32-static as binfmt interpreter for mipsn32
2024-07-03T19:45:05Z Setting /usr/bin/qemu-mipsn32el-static as binfmt interpreter for mipsn32el
2024-07-03T19:45:05Z Setting /usr/bin/qemu-mips64-static as binfmt interpreter for mips64
2024-07-03T19:45:05Z Setting /usr/bin/qemu-mips64el-static as binfmt interpreter for mips64el
2024-07-03T19:45:05Z Setting /usr/bin/qemu-sh4-static as binfmt interpreter for sh4
2024-07-03T19:45:05Z Setting /usr/bin/qemu-sh4eb-static as binfmt interpreter for sh4eb
2024-07-03T19:45:05Z Setting /usr/bin/qemu-s390x-static as binfmt interpreter for s390x
2024-07-03T19:45:05Z Setting /usr/bin/qemu-aarch64-static as binfmt interpreter for aarch64
2024-07-03T19:45:05Z Setting /usr/bin/qemu-aarch64_be-static as binfmt interpreter for aarch64_be
2024-07-03T19:45:05Z Setting /usr/bin/qemu-hppa-static as binfmt interpreter for hppa
2024-07-03T19:45:05Z Setting /usr/bin/qemu-riscv32-static as binfmt interpreter for riscv32
2024-07-03T19:45:05Z Setting /usr/bin/qemu-riscv64-static as binfmt interpreter for riscv64
2024-07-03T19:45:05Z Setting /usr/bin/qemu-xtensa-static as binfmt interpreter for xtensa
2024-07-03T19:45:05Z Setting /usr/bin/qemu-xtensaeb-static as binfmt interpreter for xtensaeb
2024-07-03T19:45:05Z Setting /usr/bin/qemu-microblaze-static as binfmt interpreter for microblaze
2024-07-03T19:45:05Z Setting /usr/bin/qemu-microblazeel-static as binfmt interpreter for microblazeel
2024-07-03T19:45:05Z Setting /usr/bin/qemu-or1k-static as binfmt interpreter for or1k
2024-07-03T19:45:05Z Setting /usr/bin/qemu-hexagon-static as binfmt interpreter for hexagon
2024-07-03T19:45:06Z #1 [internal] load build definition from Dockerfile
2024-07-03T19:45:06Z #1 transferring dockerfile: 1.01kB done
2024-07-03T19:45:06Z #1 DONE 0.1s
2024-07-03T19:45:06Z 
2024-07-03T19:45:06Z #2 [auth] library/centos:pull token for registry-1.docker.io
2024-07-03T19:45:06Z #2 DONE 0.0s
2024-07-03T19:45:06Z 
2024-07-03T19:45:06Z #3 [auth] adoptopenjdk/openjdk14:pull token for registry-1.docker.io
2024-07-03T19:45:06Z #3 DONE 0.0s
2024-07-03T19:45:06Z 
2024-07-03T19:45:06Z #4 [internal] load metadata for docker.io/library/centos:7
2024-07-03T19:45:07Z #4 DONE 0.7s
2024-07-03T19:45:07Z 
2024-07-03T19:45:07Z #5 [internal] load metadata for docker.io/adoptopenjdk/openjdk14:armv7l-centos-jdk-14.0.2_12
2024-07-03T19:45:07Z #5 DONE 0.7s
2024-07-03T19:45:07Z 
2024-07-03T19:45:07Z #6 [internal] load .dockerignore
2024-07-03T19:45:07Z #6 transferring context: 2B done
2024-07-03T19:45:07Z #6 DONE 0.0s
2024-07-03T19:45:07Z 
2024-07-03T19:45:07Z #7 [stage-1 1/4] FROM docker.io/library/centos:7@sha256:be65f488b7764ad3638f236b7b515b3678369a5124c47b8d32916d6487418ea4
2024-07-03T19:45:07Z #7 resolve docker.io/library/centos:7@sha256:be65f488b7764ad3638f236b7b515b3678369a5124c47b8d32916d6487418ea4 0.0s done
2024-07-03T19:45:07Z #7 DONE 0.1s
2024-07-03T19:45:07Z 
2024-07-03T19:45:07Z #8 [build 1/4] FROM docker.io/adoptopenjdk/openjdk14:armv7l-centos-jdk-14.0.2_12@sha256:b4688d55ba6fe65b1810a6e5fbc2bed5e29ce977e696b6d2e9dbe092a44f0371
2024-07-03T19:45:07Z #8 resolve docker.io/adoptopenjdk/openjdk14:armv7l-centos-jdk-14.0.2_12@sha256:b4688d55ba6fe65b1810a6e5fbc2bed5e29ce977e696b6d2e9dbe092a44f0371 0.0s done
2024-07-03T19:45:07Z #8 sha256:0b55b0b0b22c736247c0d6dc7b21b2447811e560821da1daacedd4f669556a2e 0B / 198.00MB 0.2s

....................

Why is this, it seems to be saying the image songkong/songkong-arm32 does not exist but it seems to have built ok?

Note it says

2024-07-12T08:04:31Z WARNING: No output specified with docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load

Could that be the issue ?

2024-07-12T08:03:56Z Cloning into '.'...
2024-07-12T08:03:57Z Warning: Permanently added the ECDSA host key for IP address '104.192.142.24' to the list of known hosts.
2024-07-12T08:03:58Z Reset branch 'master'
2024-07-12T08:03:58Z Your branch is up to date with 'origin/master'.
2024-07-12T08:03:59Z Executing build hook...
2024-07-12T08:04:05Z mybuilder
2024-07-12T08:04:05Z #1 [internal] booting buildkit
2024-07-12T08:04:06Z #1 pulling image moby/buildkit:buildx-stable-1
2024-07-12T08:04:14Z #1 pulling image moby/buildkit:buildx-stable-1 8.2s done
2024-07-12T08:04:14Z #1 creating container buildx_buildkit_mybuilder0
2024-07-12T08:04:18Z #1 creating container buildx_buildkit_mybuilder0 3.9s done
2024-07-12T08:04:18Z #1 DONE 12.1s
2024-07-12T08:04:18Z Name:          mybuilder
2024-07-12T08:04:18Z Driver:        docker-container
2024-07-12T08:04:18Z Last Activity: 2024-07-12 08:04:05 +0000 UTC
2024-07-12T08:04:18Z 
2024-07-12T08:04:18Z Nodes:
2024-07-12T08:04:18Z Name:      mybuilder0
2024-07-12T08:04:18Z Endpoint:  unix:///var/run/docker.sock
2024-07-12T08:04:18Z Status:    running
2024-07-12T08:04:18Z Buildkit:  v0.14.1
2024-07-12T08:04:18Z Platforms: linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/386
2024-07-12T08:04:18Z Unable to find image 'multiarch/qemu-user-static:latest' locally
2024-07-12T08:04:18Z latest: Pulling from multiarch/qemu-user-static
2024-07-12T08:04:18Z 205dae5015e7: Pulling fs layer
2024-07-12T08:04:18Z 816739e52091: Pulling fs layer
2024-07-12T08:04:18Z 30abb83a18eb: Pulling fs layer
2024-07-12T08:04:18Z 0657daef200b: Pulling fs layer
2024-07-12T08:04:18Z 30c9c93f40b9: Pulling fs layer
2024-07-12T08:04:18Z 0657daef200b: Waiting
2024-07-12T08:04:18Z 30c9c93f40b9: Waiting
2024-07-12T08:04:18Z 816739e52091: Verifying Checksum
2024-07-12T08:04:18Z 816739e52091: Download complete
2024-07-12T08:04:18Z 30abb83a18eb: Verifying Checksum
2024-07-12T08:04:18Z 30abb83a18eb: Download complete
2024-07-12T08:04:18Z 205dae5015e7: Verifying Checksum
2024-07-12T08:04:18Z 205dae5015e7: Download complete
2024-07-12T08:04:18Z 0657daef200b: Verifying Checksum
2024-07-12T08:04:18Z 0657daef200b: Download complete
2024-07-12T08:04:19Z 205dae5015e7: Pull complete
2024-07-12T08:04:19Z 816739e52091: Pull complete
2024-07-12T08:04:19Z 30abb83a18eb: Pull complete
2024-07-12T08:04:20Z 0657daef200b: Pull complete
2024-07-12T08:04:20Z 30c9c93f40b9: Verifying Checksum
2024-07-12T08:04:20Z 30c9c93f40b9: Download complete
2024-07-12T08:04:26Z 30c9c93f40b9: Pull complete
2024-07-12T08:04:26Z Digest: sha256:fe60359c92e86a43cc87b3d906006245f77bfc0565676b80004cc666e4feb9f0
2024-07-12T08:04:26Z Status: Downloaded newer image for multiarch/qemu-user-static:latest
2024-07-12T08:04:31Z Setting /usr/bin/qemu-alpha-static as binfmt interpreter for alpha
2024-07-12T08:04:31Z Setting /usr/bin/qemu-arm-static as binfmt interpreter for arm
2024-07-12T08:04:31Z Setting /usr/bin/qemu-armeb-static as binfmt interpreter for armeb
2024-07-12T08:04:31Z Setting /usr/bin/qemu-sparc-static as binfmt interpreter for sparc
2024-07-12T08:04:31Z Setting /usr/bin/qemu-sparc32plus-static as binfmt interpreter for sparc32plus
2024-07-12T08:04:31Z Setting /usr/bin/qemu-sparc64-static as binfmt interpreter for sparc64
2024-07-12T08:04:31Z Setting /usr/bin/qemu-ppc-static as binfmt interpreter for ppc
2024-07-12T08:04:31Z Setting /usr/bin/qemu-ppc64-static as binfmt interpreter for ppc64
2024-07-12T08:04:31Z Setting /usr/bin/qemu-ppc64le-static as binfmt interpreter for ppc64le
2024-07-12T08:04:31Z Setting /usr/bin/qemu-m68k-static as binfmt interpreter for m68k
2024-07-12T08:04:31Z Setting /usr/bin/qemu-mips-static as binfmt interpreter for mips
2024-07-12T08:04:31Z Setting /usr/bin/qemu-mipsel-static as binfmt interpreter for mipsel
2024-07-12T08:04:31Z Setting /usr/bin/qemu-mipsn32-static as binfmt interpreter for mipsn32
2024-07-12T08:04:31Z Setting /usr/bin/qemu-mipsn32el-static as binfmt interpreter for mipsn32el
2024-07-12T08:04:31Z Setting /usr/bin/qemu-mips64-static as binfmt interpreter for mips64
2024-07-12T08:04:31Z Setting /usr/bin/qemu-mips64el-static as binfmt interpreter for mips64el
2024-07-12T08:04:31Z Setting /usr/bin/qemu-sh4-static as binfmt interpreter for sh4
2024-07-12T08:04:31Z Setting /usr/bin/qemu-sh4eb-static as binfmt interpreter for sh4eb
2024-07-12T08:04:31Z Setting /usr/bin/qemu-s390x-static as binfmt interpreter for s390x
2024-07-12T08:04:31Z Setting /usr/bin/qemu-aarch64-static as binfmt interpreter for aarch64
2024-07-12T08:04:31Z Setting /usr/bin/qemu-aarch64_be-static as binfmt interpreter for aarch64_be
2024-07-12T08:04:31Z Setting /usr/bin/qemu-hppa-static as binfmt interpreter for hppa
2024-07-12T08:04:31Z Setting /usr/bin/qemu-riscv32-static as binfmt interpreter for riscv32
2024-07-12T08:04:31Z Setting /usr/bin/qemu-riscv64-static as binfmt interpreter for riscv64
2024-07-12T08:04:31Z Setting /usr/bin/qemu-xtensa-static as binfmt interpreter for xtensa
2024-07-12T08:04:31Z Setting /usr/bin/qemu-xtensaeb-static as binfmt interpreter for xtensaeb
2024-07-12T08:04:31Z Setting /usr/bin/qemu-microblaze-static as binfmt interpreter for microblaze
2024-07-12T08:04:31Z Setting /usr/bin/qemu-microblazeel-static as binfmt interpreter for microblazeel
2024-07-12T08:04:31Z Setting /usr/bin/qemu-or1k-static as binfmt interpreter for or1k
2024-07-12T08:04:31Z Setting /usr/bin/qemu-hexagon-static as binfmt interpreter for hexagon
2024-07-12T08:04:31Z WARNING: No output specified with docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
2024-07-12T08:04:32Z #1 [internal] load build definition from Dockerfile
2024-07-12T08:04:32Z #1 transferring dockerfile: 1.01kB done
2024-07-12T08:04:32Z #1 DONE 0.1s
2024-07-12T08:04:32Z 
2024-07-12T08:04:32Z #2 [auth] adoptopenjdk/openjdk14:pull token for registry-1.docker.io
2024-07-12T08:04:32Z #2 DONE 0.0s
2024-07-12T08:04:32Z 
2024-07-12T08:04:32Z #3 [auth] library/centos:pull token for registry-1.docker.io
2024-07-12T08:04:32Z #3 DONE 0.0s
2024-07-12T08:04:32Z 
2024-07-12T08:04:32Z #4 [internal] load metadata for docker.io/adoptopenjdk/openjdk14:armv7l-centos-jdk-14.0.2_12
2024-07-12T08:04:32Z #4 ...
2024-07-12T08:04:32Z 
2024-07-12T08:04:32Z #5 [internal] load metadata for docker.io/library/centos:7
2024-07-12T08:04:32Z #5 DONE 0.8s
2024-07-12T08:04:33Z 
2024-07-12T08:04:33Z #4 [internal] load metadata for docker.io/adoptopenjdk/openjdk14:armv7l-centos-jdk-14.0.2_12
2024-07-12T08:04:33Z #4 DONE 0.9s
2024-07-12T08:04:33Z 
2024-07-12T08:04:33Z #6 [internal] load .dockerignore
2024-07-12T08:04:33Z #6 transferring context: 2B 0.0s done
2024-07-12T08:04:33Z #6 DONE 0.0s
2024-07-12T08:04:33Z 
2024-07-12T08:04:33Z #7 [build 1/4] FROM docker.io/adoptopenjdk/openjdk14:armv7l-centos-jdk-14.0.2_12@sha256:b4688d55ba6fe65b1810a6e5fbc2bed5e29ce977e696b6d2e9dbe092a44f0371
2024-07-12T08:04:33Z #7 resolve docker.io/adoptopenjdk/openjdk14:armv7l-centos-jdk-14.0.2_12@sha256:b4688d55ba6fe65b1810a6e5fbc2bed5e29ce977e696b6d2e9dbe092a44f0371 0.0s done
2024-07-12T08:04:33Z #7 DONE 0.0s
2024-07-12T08:04:33Z 
2024-07-12T08:04:33Z #8 [stage-1 1/4] FROM docker.io/library/centos:7@sha256:be65f488b7764ad3638f236b7b515b3678369a5124c47b8d32916d6487418ea4
2024-07-12T08:04:33Z #8 resolve docker.io/library/centos:7@sha256:be65f488b7764ad3638f236b7b515b3678369a5124c47b8d32916d6487418ea4 0.0s done
2024-07-12T08:04:33Z #8 DONE 0.0s
2024-07-12T08:04:33Z 
2024-07-12T08:04:33Z #7 [build 1/4] FROM docker.io/adoptopenjdk/openjdk14:armv7l-centos-jdk-14.0.2_12@sha256:b4688d55ba6fe65b1810a6e5fbc2bed5e29ce977e696b6d2e9dbe092a44f0371
2024-07-12T08:04:33Z #7 DONE 0.1s
2024-07-12T08:04:33Z 
2024-07-12T08:04:33Z #8 [stage-1 1/4] FROM docker.io/library/centos:7@sha256:be65f488b7764ad3638f236b7b515b3678369a5124c47b8d32916d6487418ea4
2024-07-12T08:04:33Z #8 sha256:193bcbf05ff9ae85ac1a58cacd9c07f8f4297dc648808c347cceb3797ae603af 0B / 70.03MB 0.2s
2024-07-12T08:04:33Z #8 sha256:193bcbf05ff9ae85ac1a58cacd9c07f8f4297dc648808c347cceb3797ae603af 11.53MB / 70.03MB 0.5s
2024-07-12T08:04:33Z #8 sha256:193bcbf05ff9ae85ac1a58cacd9c07f8f4297dc648808c347cceb3797ae603af 32.51MB / 70.03MB 0.8s
2024-07-12T08:04:34Z #8 sha256:193bcbf05ff9ae85ac1a58cacd9c07f8f4297dc648808c347cceb3797ae603af 46.14MB / 70.03MB 1.1s
2024-07-12T08:04:34Z #8 sha256:193bcbf05ff9ae85ac1a58cacd9c07f8f4297dc648808c347cceb3797ae603af 58.72MB / 70.03MB 1.2s
2024-07-12T08:04:34Z #8 sha256:193bcbf05ff9ae85ac1a58cacd9c07f8f4297dc648808c347cceb3797ae603af 70.03MB / 70.03MB 1.5s
2024-07-12T08:04:35Z #8 sha256:193bcbf05ff9ae85ac1a58cacd9c07f8f4297dc648808c347cceb3797ae603af 70.03MB / 70.03MB 2.5s done
2024-07-12T08:04:35Z #8 DONE 2.8s
2024-07-12T08:04:35Z 
2024-07-12T08:04:35Z #7 [build 1/4] FROM docker.io/adoptopenjdk/openjdk14:armv7l-centos-jdk-14.0.2_12@sha256:b4688d55ba6fe65b1810a6e5fbc2bed5e29ce977e696b6d2e9dbe092a44f0371
2024-07-12T08:04:35Z #7 sha256:0b55b0b0b22c736247c0d6dc7b21b2447811e560821da1daacedd4f669556a2e 132.12MB / 198.00MB 2.7s
2024-07-12T08:04:35Z #7 sha256:83c03e4400804660ec377662b61bf20e68e92abd1a635726b631c1803e63f56a 66.36MB / 66.36MB 2.7s
2024-07-12T08:04:36Z #7 sha256:0b55b0b0b22c736247c0d6dc7b21b2447811e560821da1daacedd4f669556a2e 149.95MB / 198.00MB 3.0s
2024-07-12T08:04:36Z #7 sha256:0b55b0b0b22c736247c0d6dc7b21b2447811e560821da1daacedd4f669556a2e 161.48MB / 198.00MB 3.5s
2024-07-12T08:04:36Z #7 sha256:83c03e4400804660ec377662b61bf20e68e92abd1a635726b631c1803e63f56a 66.36MB / 66.36MB 3.4s done
2024-07-12T08:04:37Z #7 sha256:0b55b0b0b22c736247c0d6dc7b21b2447811e560821da1daacedd4f669556a2e 182.45MB / 198.00MB 3.9s
2024-07-12T08:04:37Z #7 sha256:0b55b0b0b22c736247c0d6dc7b21b2447811e560821da1daacedd4f669556a2e 197.13MB / 198.00MB 4.1s
2024-07-12T08:04:39Z #7 sha256:0b55b0b0b22c736247c0d6dc7b21b2447811e560821da1daacedd4f669556a2e 198.00MB / 198.00MB 6.7s done
2024-07-12T08:04:39Z #7 DONE 6.8s
2024-07-12T08:04:39Z 
2024-07-12T08:04:39Z #8 [stage-1 1/4] FROM docker.io/library/centos:7@sha256:be65f488b7764ad3638f236b7b515b3678369a5124c47b8d32916d6487418ea4
2024-07-12T08:04:39Z #8 extracting sha256:193bcbf05ff9ae85ac1a58cacd9c07f8f4297dc648808c347cceb3797ae603af
2024-07-12T08:04:41Z #8 extracting sha256:193bcbf05ff9ae85ac1a58cacd9c07f8f4297dc648808c347cceb3797ae603af 4.7s done
2024-07-12T08:04:41Z #8 DONE 7.6s
2024-07-12T08:04:41Z 
2024-07-12T08:04:41Z #7 [build 1/4] FROM docker.io/adoptopenjdk/openjdk14:armv7l-centos-jdk-14.0.2_12@sha256:b4688d55ba6fe65b1810a6e5fbc2bed5e29ce977e696b6d2e9dbe092a44f0371
2024-07-12T08:04:41Z #7 extracting sha256:83c03e4400804660ec377662b61bf20e68e92abd1a635726b631c1803e63f56a
2024-07-12T08:04:46Z #7 extracting sha256:83c03e4400804660ec377662b61bf20e68e92abd1a635726b631c1803e63f56a 5.1s done
2024-07-12T08:04:46Z #7 extracting sha256:0b55b0b0b22c736247c0d6dc7b21b2447811e560821da1daacedd4f669556a2e
2024-07-12T08:04:49Z #7 ...
2024-07-12T08:04:49Z 
2024-07-12T08:04:49Z #9 [stage-1 2/4] RUN mkdir -p /opt
2024-07-12T08:04:49Z #9 DONE 7.8s
2024-07-12T08:04:49Z 
2024-07-12T08:04:49Z #7 [build 1/4] FROM docker.io/adoptopenjdk/openjdk14:armv7l-centos-jdk-14.0.2_12@sha256:b4688d55ba6fe65b1810a6e5fbc2bed5e29ce977e696b6d2e9dbe092a44f0371
2024-07-12T08:04:51Z #7 extracting sha256:0b55b0b0b22c736247c0d6dc7b21b2447811e560821da1daacedd4f669556a2e 5.0s done
2024-07-12T08:04:51Z #7 DONE 17.0s
2024-07-12T08:04:51Z 
2024-07-12T08:04:51Z #10 [build 2/4] RUN /opt/java/openjdk/bin/jlink --module-path=/opt/java/openjdk/jmods --add-modules java.desktop,java.datatransfer,java.logging,java.management,java.naming,java.net.http,java.prefs,java.scripting,java.sql,jdk.management,jdk.unsupported,jdk.jcmd,jdk.crypto.ec,jdk.dynalink --output /opt/songkong/jre
2024-07-12T08:04:51Z #10 0.204 /bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
2024-07-12T08:06:21Z #10 DONE 89.6s
2024-07-12T08:06:21Z 
2024-07-12T08:06:21Z #11 [build 3/4] RUN mkdir -p /opt  && curl http://www.jthink.net/songkong/downloads/current/songkong-linux-docker.tgz?val=1169.1| tar -C /opt -xzf - && find /opt/songkong -perm /u+x -type f -print0 | xargs -0 chmod a+x
2024-07-12T08:06:21Z #11 0.231 /bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
2024-07-12T08:06:21Z #11 0.578   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
2024-07-12T08:06:21Z #11 0.618                                  Dload  Upload   Total   Spent    Left  Speed
2024-07-12T08:06:41Z #11 0.626 
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  1 86.9M    1 1097k    0     0  1396k      0  0:01:03 --:--:--  0:01:03 1434k
  6 86.9M    6 5801k    0     0  3252k      0  0:00:27  0:00:01  0:00:26 3290k
 11 86.9M   11 10.2M    0     0  3758k      0  0:00:23  0:00:02  0:00:21 3786k
 17 86.9M   17 15.1M    0     0  4095k      0  0:00:21  0:00:03  0:00:18 4117k
 22 86.9M   22 19.8M    0     0  4243k      0  0:00:20  0:00:04  0:00:16 4262k
 27 86.9M   27 24.1M    0     0  4269k      0  0:00:20  0:00:05  0:00:15 4720k
 33 86.9M   33 28.8M    0     0  4351k      0  0:00:20  0:00:06  0:00:14 4742k
 37 86.9M   37 32.7M    0     0  4316k      0  0:00:20  0:00:07  0:00:13 4626k
 42 86.9M   42 37.0M    0     0  4319k      0  0:00:20  0:00:08  0:00:12 4489k
 47 86.9M   47 41.4M    0     0  4345k      0  0:00:20  0:00:09  0:00:11 4441k
 52 86.9M   52 45.6M    0     0  4330k      0  0:00:20  0:00:10  0:00:10 4400k
 58 86.9M   58 50.6M    0     0  4400k      0  0:00:20  0:00:11  0:00:09 4466k
 63 86.9M   63 54.8M    0     0  4394k      0  0:00:20  0:00:12  0:00:08 4515k
 66 86.9M   66 57.8M    0     0  4299k      0  0:00:20  0:00:13  0:00:07 4263k
 71 86.9M   71 62.3M    0     0  4321k      0  0:00:20  0:00:14  0:00:06 4275k
 76 86.9M   76 66.7M    0     0  4328k      0  0:00:20  0:00:15  0:00:05 4324k
 83 86.9M   83 72.2M    0     0  4410k      0  0:00:20  0:00:16  0:00:04 4433k
 89 86.9M   89 78.2M    0     0  4508k      0  0:00:19  0:00:17  0:00:02 4800k
 93 86.9M   93 81.7M    0     0  4454k      0  0:00:19  0:00:18  0:00:01 4881k
 99 86.9M   99 86.8M    0     0  4496k      0  0:00:19  0:00:19 --:--:-- 5013k
100 86.9M  100 86.9M    0     0  4489k      0  0:00:19  0:00:19 --:--:-- 5113k
2024-07-12T08:06:42Z #11 DONE 21.2s
2024-07-12T08:06:42Z 
2024-07-12T08:06:42Z #12 [build 4/4] RUN rm -fr /opt/java
2024-07-12T08:06:42Z #12 0.262 /bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
2024-07-12T08:06:42Z #12 DONE 0.5s
2024-07-12T08:06:43Z 
2024-07-12T08:06:43Z #13 [stage-1 3/4] COPY --from=build /opt/songkong /opt/songkong
2024-07-12T08:06:45Z #13 DONE 2.2s
2024-07-12T08:06:45Z 
2024-07-12T08:06:45Z #14 [stage-1 4/4] WORKDIR /opt/songkong
2024-07-12T08:06:45Z #14 DONE 0.1s
2024-07-12T08:06:45Z Image not found! Build may have failed.
2024-07-12T08:06:45Z build hook failed! (1)

Solution

  • At last check, Docker Hub builds do not support multi-platform options. You can follow the progress on that at:

    The most popular method to build multi-platform images these days is to use GitHub Actions. With bitbucket, it looks like they support multi-platform builds in pipelines.


    From the updated question, there are a few things that don't align with the documented capabilities of the hooks in Docker Hub builders:

    The resulting hooks/build file would look like:

    #!/bin/bash
    
    set -e
    
    docker run --rm --privileged multiarch/qemu-user-static:register
    docker buildx create --name mybuilder --use
    # the variables in the below command are populated by Hub and should not be altered
    # the --load is important here to output to the docker engine
    docker buildx build --platform linux/arm/v7 -f "${DOCKERFILE_PATH}" -t "${IMAGE_NAME}" --load .
    

    Note that this gets into undocumented behaviors of the Hub builders since they don't specify support for buildx.

    Hooks are documented here: https://docs.docker.com/docker-hub/builds/advanced/. And details of other people using hooks can be found in links from the above GitHub issues.