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

qemu-x86_64-static: can't COPY from qemu-user-static:x86_64-x86_64 image #105

Open
Bounz opened this issue Feb 23, 2020 · 3 comments
Open

Comments

@Bounz
Copy link

Bounz commented Feb 23, 2020

Is this a bug report, feature (enhancement) request or question? (leave only one on its own line)

/kind bug

Description:

I'm trying to create dockerfile for base image to be built by CI (drone) for multiple architectures. I want to have a single dockerfile so I'm using ARGs to pass arch value into dockerfile.

Steps to reproduce the issue:

  1. Create test.dockerfile
ARG arch
ARG qemu
FROM multiarch/qemu-user-static:x86_64-${qemu} as qemu
FROM ${arch}/mono

ARG qemu
COPY --from=qemu /usr/bin/qemu-${qemu}-static /usr/bin
  1. run docker build -f test.dockerfile --build-arg arch=amd64 --build-arg qemu=x86_64 -t test:amd64 .

Describe the results you received:

Step 6/6 : COPY --from=qemu /usr/bin/qemu-${qemu}-static /usr/bin
 COPY failed: Forbidden path outside the build context: usr/bin/qemu-x86_64-static ()

Describe the results you expected:
qemu-x86_64-static is being copied to /usr/bin

If I run docker build -f test.dockerfile --build-arg arch=arm32v7 --build-arg qemu=arm -t test:amd64 . everything works fine.

Environment:

  • QEMU version: (if you can know it): ?
  • Container application: Docker

Output of docker version, podman version or singularity version

Client: Docker Engine - Community
 Version:           19.03.5
 API version:       1.40
 Go version:        go1.12.12
 Git commit:        633a0ea
 Built:             Wed Nov 13 07:22:34 2019
 OS/Arch:           darwin/amd64
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          19.03.5
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.12
  Git commit:       633a0ea
  Built:            Wed Nov 13 07:29:19 2019
  OS/Arch:          linux/amd64
  Experimental:     true
 containerd:
  Version:          v1.2.10
  GitCommit:        b34a5c8af56e510852c35414db4c1f4fa6172339
 runc:
  Version:          1.0.0-rc8+dev
  GitCommit:        3e425f80a8c931f88e6d94a8c831b9d5aa481657
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Additional information optionally:

@Bounz Bounz changed the title qemu-x86_64-static: can't COPY from tagged image qemu-x86_64-static: can't COPY from qemu-user-static:x86_64-x86_64 image Feb 23, 2020
@umarcor
Copy link

umarcor commented Apr 4, 2020

@Bounz, AFAIK, all the resources provided by this project are for x86_64/amd64 hosts only. Hence, when you provide qemu=x86_64, you are asking it to extract qemu-x86_64-user from an image meant to be executed on x86_64 hosts. For (now) obvious reasons, that file does not exist, because there is no required architecture conversion. Such a context would fall on the KVM area of QEMU, not qemu-user.

Should you want to generate images for hosts other than x86_64 (for example, execute regular docker containers on RPi), I suggest you to have a look at dbhi/qus. Unlike this repo, qus targets both multiple host architectures and multiple guest containers. See e.g. dbhi/qus#2 (comment).

--build-arg arch=arm32v7 --build-arg qemu=arm

I believe you want to set qemu=armhf instead. qemu=arm would better match armv32v6.

@bmw
Copy link

bmw commented Jul 30, 2020

https://github.com/multiarch/qemu-user-static/releases/download/v5.0.0-2/qemu-x86_64-static exists. Why can't the file be in multiarch/qemu-user-static:x86_64-x86_64 to allow this pattern?

@Metabaron1
Copy link

Metabaron1 commented Oct 26, 2020

I have checked multiarch/qemu-user-static:x86_64-x86_64 content and it's empty... I was looking for this file in docker image to have an uniform deployment for every architecture, even if it would lead to run x86 on x86 : what's the problem as it's working if I get the file from tarball? I just would prefer to get this file from image because it's simplier to deploy. Why do you prevent it?
As you provide the file in tarball, this file should also be provided in docker image, or else remove both ...

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

4 participants