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:

[email protected]:~/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?

Source: StackOverflow