-
Notifications
You must be signed in to change notification settings - Fork 221
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
"go install" command fails while running inside s390x docker container on x86_64 host using qemu #110
Comments
Hi @nirmannarang! golang seems te be tricky on qemu-user, and several bugs have been fixed in the last months: It might be interesting trying this without Docker (using qemu-user on the host) and opening a bug report in QEMU. |
@umarcor Docker requirement is necessary actually. This is part of CI which builds this s390x go-build image on x86 and is then published on docker hub. And this fails only for s390x, other architectures like ppc64le, arm64, etc. are running successfully through this process. |
@umarcor |
Yes, I understand that. However, I think that this might be an issue with "qemu-user allowing s390x targets on x86_64 hosts". Because you seem to have access to an s390x host (you wrote "When I build the same Dockerfile.s390x on an s390x machine, it is built successfully"), I'm suggesting you to take Docker out of the equation FOR TESTING PURPOSES ONLY. Once you find/fix the issue, you can go back to using the container, as you expect.
This is cross-compilation; qemu-user is not being used. I suggest to download a go installation for s390x into your host. If you try to execute it straightaway, it should fail. If you run |
I installed qemu on x86 Ubuntu host. Extracted s390x go 1.14.2 binaries on the same. Ran the following commands:
|
Another note, on x86 host, I ran the following commands:
Ran an s390x golang 1.14.2 alpine container on x86 host
Inside s390x container, ran following go commands:
Strange that this is successful but docker build fails using same command inside Dockerfile.s390x. |
That seems to confirm that this is an issue upstream with allowing s390x targets on x86_64 hosts. I suggest to open a bug report as commented in #114 (comment). |
The issue has been fixed with the latest release |
Is this a bug report, feature (enhancement) request or question? (leave only one on its own line)
/kind bug
Description:
Steps to reproduce the issue:
Register x86_64 host with the latest qemu-user-static.
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
Build the following Docker Image using following Dockerfile.s390x using command
docker build -t test/crossbuild:latest-s390x -f Dockerfile.s390x .
Dockerfile.s390x
The build just hangs at
RUN go install -v std
Illegal instruction (core dumped)
is thrown.Register x86_64 host with the latest qemu-user-static.
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker run -it -v /home/test/qemu-s390x-static:/usr/bin/qemu-s390x-static s390x/golang:1.14.2-alpine3.11
Inside s390x container:
Describe the results you received:
Step 2 just halts while running step
RUN go install -v std
while building Dockerfile.s390x.Step 3 gives the following error:
Illegal instruction (core dumped)
Describe the results you expected:
The command should have been successful without any output.
Environment:
x86_64 Ub18.04 4.15.0-101-generic Ubuntu SMP x86_64 GNU/Linux
Output of
docker version
,podman version
orsingularity version
Additional information optionally:
When I build the same Dockerfile.s390x on an s390x machine, it is built successfully.
The text was updated successfully, but these errors were encountered: