-
Notifications
You must be signed in to change notification settings - Fork 377
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
Docker in Docker doesn't seem to find / forward the volume mounts #1283
Comments
Can you please input the details of the error into the description instead of having it in another issue? Thanks! what virtual filesystem does docker end up using? Does it work better when using cross from the main branch? |
Sure. Docker is using overlay2. I tried this all again using the cross main branch and it gives the same error.
If I look at the GraphDriver output from docker inspect:
And again if I look at
If I run the cross image with
|
Ahh, let me add the
And the
|
I'm facing the same problem, any ideas on how to solve it? If there is a solution I can work on it. |
@lumasepa are you also setting |
I tried with and without that env var, but in my case I have dind with two docker demons, one for the outer container and the other running inside the outer container to run the inner container. So host has the crate directory, outer mounts the crate directory and has the rust tooling + cross, cross runs in the outer with its container having access to rust tooling. I changed the setup to use outer docker and inner podman and it works without problems, and I don't have to run docker demon inside of docker. Sorry for the late response, I've been busy with other stuff, I came back to this today. |
Checklist
Describe your issue
Using a clean Ubuntu Server 22.04.2 LTS system, running
cross
inside of one Docker container gives me the same errorBuild fails with sh: 1: cargo: not found
listed in #260.If
/var/lib/docker
is not bind mounted to the outer Docker instance, when cross goes to forward some of those mounts, there is nothing to forward to the inner Docker instance:If you run the container above and drop into a shell, you can examine the paths available in /var/lib and see what is missing.
I don't have a solution to this yet. It should be possible to bind mount
/var/lib/docker
, but theroot:root
permissions will be an issue.System Info
Host system:
Outer Docker is rust:latest (debian:11, 11.7, bullseye, bullseye-20230612):
Inner Docker is the aarch64-unknown-linux-gnu image.
What target(s) are you cross-compiling for?
aarch64-unknown-linux-gnu
Which operating system is the host (e.g computer cross is on) running?
What architecture is the host?
What container engine is cross using?
cross version
cross 0.2.5
Example
#260 (comment)
Examining the Docker command line that is run by cross, it finds the
/var/lib/docker
mounts, I believe by querying thedocker.sock
, but because the outer Docker container does not mount/var/lib/docker
, the inner Docker can't then access any of those mounts.It would be an issue anyways as the outer Docker container marks all mounts
root:root
in/var/lib/docker
.Additional information / notes
I'm trying to think of workarounds.
One of which would be to run
rustup
in my non-admin account in the host system, and then run theaarch64-unknown-linux-gnu
container.Another workaround might be
Cross.toml
offering a way to specify what folders to mount for which tools.Another workaround might be to use a Docker managed volume for the tools and cross.
Final option would be to reproduce the mounts in a
docker-compose.yml
and reuse the cross-rs containers from the host system.The text was updated successfully, but these errors were encountered: