Skip to content

How to build docker arm version? #39380

@atline

Description

@atline

I use the source code here to build an arm version docker binary.

First I want to test if it works for x86-64, so I use next to build, it's ok to generate x86-64 version binary:

make static DOCKER_BUILD_PKGS=static-linux

Then I start to build arm docker binary, 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

What I needed is just the binary like in here

I ask this question on stackoverflow for some days but could not find help, so had to move here for help, sorry for inconvenience if not find a correct place to ask.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions