Open AndreyMZ opened 11 months ago
I seem to have encountered this same problem, getting permission denied on reading files under /home/runner/
with the below command on CI ubuntu-latest
image.
cross test --target aarch64-unknown-linux-gnu -- --nocapture
Checklist
Describe your issue
The documentation suggests to run
cross
from inside a container like so:In general, this is wrong, because the container started from the
my/development-image
may run on behalf of a user different from the owner of the files in.
. Usually, it runs on behalf of root. For example,ghcr.io/cross-rs/cross
runs on behalf of root. This results in wrong ownership of files generated by cross (./target/**
).A proper way to run such tools is to use the
--user
option:docker
group to allow communicating via/var/run/docker.sock
(which is readable and writable byroot:docker
).But this does not work with ghcr.io/cross-rs/cross. See the detail below.
What target(s) are you cross-compiling for?
No response
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
Actual result
Expected result
No such error.
Additional information / notes
Root cause
Rust is installed into
/root/.cargo/bin/
:Possible solution
RUSTUP_HOME
andCARGO_HOME
. See https://rust-lang.github.io/rustup/installation/index.html#choosing-where-to-install.docker run ...
command in the documentation about "Docker in Docker".Additional information
The official Docker image
rust
does not have such problem:because Rust is installed into
/usr/local/cargo/bin
: