Skip to content

[Dockerfile] Multi arch image build support in nerdctl container image #1321

@rajpratik71

Description

@rajpratik71

Description

Inside nerdctl container image, wanted to build or run container image having different arch.

Steps to reproduce the issue

  1. Run nerdctl in the container using the official image at ghcr.io/containerd/nerdctl:master by docker run --rm --privileged -it ghcr.io/containerd/nerdctl:master
  2. Try to run an "arm64 based ubuntu image" by nerdctl run --rm -it arm64v8/ubuntu uname -mthe

Describe the results you received and expected

Above operation to run image failed with below log

root@fc84829df24d:/# nerdctl run --rm -it arm64v8/ubuntu uname -m
docker.io/arm64v8/ubuntu:latest: resolved |++++++++++++++++++++++++++++++++++++++|
manifest-sha256:6f266288ee3e1fce297f66073c06a33fb0f3a6829081d3a1ccb4d70ab6804f6b: done |++++++++++++++++++++++++++++++++++++++|
config-sha256:bad148f8963fb9be6c8c260ce8a65aadd1cdfdd95e5bd16867d0f987cd7ebff3: done |++++++++++++++++++++++++++++++++++++++|
layer-sha256:4a3049d340b7d3651a954fd25a32c42feb1086889d6287e2f15468aef865c5c4: done |++++++++++++++++++++++++++++++++++++++|
elapsed: 2.8 s total: 27.1 M (9.6 MiB/s)
exec /usr/bin/uname: exec format error

But it should got successful and completed with printing "aarch64" as below

root@c2720604c721:/# nerdctl run --rm -it arm64v8/ubuntu uname -m
docker.io/arm64v8/ubuntu:latest: resolved |++++++++++++++++++++++++++++++++++++++|
manifest-sha256:6f266288ee3e1fce297f66073c06a33fb0f3a6829081d3a1ccb4d70ab6804f6b: done |++++++++++++++++++++++++++++++++++++++|
config-sha256:bad148f8963fb9be6c8c260ce8a65aadd1cdfdd95e5bd16867d0f987cd7ebff3: done |++++++++++++++++++++++++++++++++++++++|
layer-sha256:4a3049d340b7d3651a954fd25a32c42feb1086889d6287e2f15468aef865c5c4: done |++++++++++++++++++++++++++++++++++++++|
elapsed: 2.3 s total: 27.1 M (11.8 MiB/s)
aarch64

What version of nerdctl are you using?

root@fc84829df24d:/# nerdctl version
Client:
Version: af6ac29
OS/Arch: linux/amd64
Git commit: af6ac29
buildctl:
Version: v0.10.3
GitCommit: c8d25d9a103b70dc300a4fd55e7e576472284e31

Server:
containerd:
Version: v1.6.8
GitCommit: 9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6
runc:
Version: 1.1.3
GitCommit: v1.1.3-0-g6724737f
root@fc84829df24d:/#

Are you using a variant of nerdctl? (e.g., Rancher Desktop)

No response

Host information

root@fc84829df24d:/# nerdctl info
Client:
Namespace: default
Debug Mode: false

Server:
Server Version: v1.6.8
Storage Driver: overlayfs
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Log: fluentd journald json-file
Storage: native overlayfs stargz
Security Options:
apparmor
seccomp
Profile: default
cgroupns
Kernel Version: 5.15.0-1011-aws
Operating System: Ubuntu 22.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 967.9MiB
Name: fc84829df24d
ID: 401820f6-02be-4f43-b594-16e6470a85e5

root@fc84829df24d:/#

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions