Docker Community Forums

Share and learn in the Docker community.

How to build out docker engine arm binary?

I see this, from here I can download docker daemon & docker client for arm64 version which works.

$ ls | xargs file
containerd:      ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, for GNU/Linux 3.7.0, Go BuildID=qw3vidR0_xw6ad6RsQMc/1Mvy0xkskqC4LJM8ekEq/jvzo407uWVjZxA71fYmB/r1PXwIjd2b3xjPt0tOPD, BuildID[sha1]=f8a87e57a37d283060789f7b6b967f35c30d1385, stripped
containerd-shim: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=-FbKcwS7GH0h3bDWjYhL/LdkbOXrZDB7bUI5hVare/0n0703v40o5qYAvXmWf7/2_QBPVlcfCHqgmApuCcj, stripped
ctr:             ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, for GNU/Linux 3.7.0, Go BuildID=wcFfUczubU9WzSMgMHbV/9qJT0yqeUUvOvoLwk2rL/UJPlPmjhWvWQSGM0BjUq/nz-x_U4rhoAErNC5UKvE, BuildID[sha1]=e7fe6b82894b6bf6c70a2427481f879a5c342cbd, stripped
docker:          ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=kGbyf6df_lIBsP2zN-aw/mSkNZi8-n573BH3qCxiL/S_qDX39Bbfl6h9BHKaHC/quZgsL-4q_5_Xu6VnCVI, not stripped
dockerd:         ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, for GNU/Linux 3.7.0, Go BuildID=W3bAmk2RFppITPWcS_4m/ODbBAFymPAKdThBEapBo/FEH4KbWqvMFNQhWUKSp1/QA_f4aqjz6iKiFCV3joT, BuildID[sha1]=96792f1bae1750c4b9fc949c8988694b7378b80e, with debug_info, not stripped
docker-init:     ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, for GNU/Linux 3.7.0, BuildID[sha1]=dd417538230515ff4846537c0332512632db5bd2, stripped
docker-proxy:    ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=e1uObKFCO2MCzLXoZ4ij/IWuhN_VlndZn0XCvmPYQ/SqEk5FGxOKYjp8b-3-WP/Y_RNFD3JSDFXbk_neaAl, with debug_info, not stripped
runc:            ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, for GNU/Linux 3.7.0, Go BuildID=QhVg0N-9Q2OEb5Lj-BN1/HxEuk0yZiGKQguwkToc9/EBT3VcPRTQwVA_0eTS1l/sXiMljveurc6-0yOOwdh, BuildID[sha1]=209a7edb91edbd565b7f90f0c57bc11ba29ea9a9, with debug_info, not stripped

Then, I want to know how above binary comes out, I see this, it’s a good article which I successfully build out binary for x86-64 with make static DOCKER_BUILD_PKGS=static-linux with the source here

But, I need arm version, so I tried next 2 methods:

  1. make static DOCKER_BUILD_PKGS="static-linux cross-arm"

  2. GOOS=linux GOARCH=arm64 make static DOCKER_BUILD_PKGS=static-linux

Above 2 methods both work to build out docker client with arm version, but the docker daemon still x86-64 version, see next:

orange@orange:~/docker-ce/components/packaging/static/build/linux/docker$ ls | xargs file
containerd:      ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.32, BuildID[sha1]=b3373a479eb94f19270cd9db5b27c149dfc58b9c, stripped
containerd-shim: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped
ctr:             ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.32, BuildID[sha1]=78dba144a5f3d9c4f1d6588e4d96b8dc84531860, stripped
docker:          ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, not stripped
dockerd:         ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.32, BuildID[sha1]=bc15506d7c7e9cf25a854ef6296940821769949a, not stripped
docker-init:     ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.32, BuildID[sha1]=935ade6a155bf37269208cfb807f9d6653f34020, stripped
docker-proxy:    ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped
runc:            ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.32, BuildID[sha1]=14523b67ee2ca600894e06729f8606f5a7d0e227, not stripped

So, what I am doing wrong, how could I get arm version for dockerd?

You might want to check:

Hi, meyay,

Thanks for reply, I followd your shared link & use make DOCKER_CROSSPLATFORMS=linux/arm/v7 cross to build.

Finally I got next:

orange@orange:~/docker/bundles/cross/linux/arm/v7$ ls | xargs file
dockerd:            symbolic link to dockerd-dev
dockerd-dev:        ELF 32-bit LSB executable, ARM, EABI5 version 1 (GNU/Linux), statically 
linked, for GNU/Linux 3.2.0, 
BuildID[sha1]=8c2ec4d261986cee4657dabe773aeca0b32056e3, not stripped
dockerd-dev.md5:    ASCII text
dockerd-dev.sha256: ASCII text

You can see I can just get dockerd arm version, where is other binary like containerd, ctr, docker, docker-init, docker-proxy, runc?

But in x64 linux pc version, I can see next, all binary pc version there, what happened for arm version? I just wonder how docker official manage https://download.docker.com/linux/static/stable/aarch64/ ?

orange@orange:~/docker/bundles/binary-daemon$ ls
containerd              ctr              dockerd-dev.sha256          docker-init.sha256        rootlesskit-docker-proxy.md5     runc.sha256
containerd.md5          ctr.md5          dockerd-rootless.sh         docker-proxy              rootlesskit-docker-proxy.sha256  vpnkit
containerd.sha256       ctr.sha256       dockerd-rootless.sh.md5     docker-proxy.md5          rootlesskit.md5                  vpnkit.md5
containerd-shim         dockerd          dockerd-rootless.sh.sha256  docker-proxy.sha256       rootlesskit.sha256               vpnkit.sha256
containerd-shim.md5     dockerd-dev      docker-init                 rootlesskit               runc
containerd-shim.sha256  dockerd-dev.md5  docker-init.md5             rootlesskit-docker-proxy  runc.md5
1 Like