Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when emulating linux/amd64 on linux/s390x host #128

Open
Mon-ius opened this issue Feb 21, 2023 · 4 comments
Open

Error when emulating linux/amd64 on linux/s390x host #128

Mon-ius opened this issue Feb 21, 2023 · 4 comments

Comments

@Mon-ius
Copy link

Mon-ius commented Feb 21, 2023

Related commands:

linux1@t1:~$ sudo docker run --privileged --rm tonistiigi/binfmt --install all
installing: ppc64le OK
installing: mips64le OK
installing: mips64 OK
installing: arm64 OK
installing: arm OK
installing: 386 OK
installing: amd64 OK
installing: riscv64 OK
{
  "supported": [
    "linux/s390x"
  ],
  "emulators": [
    "qemu-aarch64",
    "qemu-arm",
    "qemu-i386",
    "qemu-mips64",
    "qemu-mips64el",
    "qemu-ppc64le",
    "qemu-riscv64",
    "qemu-x86_64"
  ]
}

First, install all platform; then run the container for linux/amd64,

linux1@t1:~$ sudo docker run --privileged --platform=linux/amd64 \
    --restart=always -itd \
    --name warp_one \
    --sysctl net.ipv6.conf.all.disable_ipv6=0 \
    --cap-add net_admin \
    -p 14888:9091 \
    -v /lib/modules:/lib/modules \
    ubuntu:focal

However, it wont start as it should be, it just keep restarting; actually same commands work when using the ARM platform, but it failed to run on S390x this time.

linux1@t1:~$ sudo docker ps -a
CONTAINER ID   IMAGE          COMMAND       CREATED              STATUS                            PORTS     NAMES
0951d5e0af79   ubuntu:focal   "/bin/bash"   About a minute ago   Restarting (132) 42 seconds ago             warp_one
@Mon-ius
Copy link
Author

Mon-ius commented Feb 21, 2023

Looks like one update 3 days before fuck up the whole emulate... Today, I found the ARM one failed to do the same task, sad :(

@Mon-ius
Copy link
Author

Mon-ius commented Feb 21, 2023

For ARM machine, I found a solution: just use docker run --privileged --rm tonistiigi/binfmt:qemu-v6.2.0 --install amd64 rather than docker run --privileged --rm tonistiigi/binfmt --install amd64.

However, the S390x still not work.

@tonistiigi
Copy link
Owner

You haven't included any indication of what syscall fails. If you can trace it to syscall and it is a QEMU regression you can report it in their tracker. It is possible that it is not a regression bug though and somebody just fixed missing error handling in the previous version.

@bltcn
Copy link

bltcn commented Dec 6, 2023

me too.
[root@ecs-01 ~]# uname -a
Linux ecs-01 4.18.0-80.7.2.el7.aarch64 #1 SMP Thu Sep 12 16:13:20 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux

[root@ecs-01 ~]# docker version
Client: Docker Engine - Community
Version: 24.0.6
API version: 1.43
Go version: go1.20.7
Git commit: ed223bc
Built: Mon Sep 4 12:33:18 2023
OS/Arch: linux/arm64
Context: default

Server: Docker Engine - Community
Engine:
Version: 24.0.6
API version: 1.43 (minimum version 1.12)
Go version: go1.20.7
Git commit: 1a79695
Built: Mon Sep 4 12:32:27 2023
OS/Arch: linux/arm64
Experimental: false
containerd:
Version: 1.6.24
GitCommit: 61f9fd88f79f081d64d6fa3bb1a0dc71ec870523
runc:
Version: 1.1.9
GitCommit: v1.1.9-0-gccaecfc
docker-init:
Version: 0.19.0
GitCommit: de40ad0

[root@ecs-01 ~]# docker buildx version
github.com/docker/buildx v0.11.2 9872040

[root@ecs-01 ~]# docker run --privileged --rm tonistiigi/binfmt --install all
installing: arm OK
installing: s390x OK
installing: ppc64le OK
installing: riscv64 OK
installing: mips64le OK
installing: amd64 OK
installing: 386 OK
installing: mips64 OK
{
"supported": [
"linux/arm64",
"linux/386",
"linux/mips64",
"linux/arm/v7",
"linux/arm/v6"
],
"emulators": [
"qemu-arm",
"qemu-i386",
"qemu-mips64",
"qemu-mips64el",
"qemu-ppc64le",
"qemu-riscv64",
"qemu-s390x",
"qemu-x86_64"
]
}

[root@ecs-01 ~]# docker buildx ls
NAME/NODE DRIVER/ENDPOINT STATUS BUILDKIT PLATFORMS
default * docker
default default running v0.11.6+616c3f613b54 linux/arm64, linux/riscv64, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6, linux/mips64le
log.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants