You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running docker-in-docker, if using a workspace and not at the root directory, the mounted volumes in the workspace are not properly adjusted to the the mounted prefix. This is because docker_mount does not use the mount finder.
What target(s) are you cross-compiling for?
No response
Which operating system is the host (e.g computer cross is on) running?
While testing the integration tests in #873, the following script fails, producing the subsequent output:
Script
#!/usr/bin/env bash# test to see that running docker-in-docker worksset -x
set -eo pipefail
if [[ -z"${TARGET}" ]];thenexport TARGET="aarch64-unknown-linux-gnu"fi
source=$(dirname "${BASH_SOURCE[0]}")
source=$(realpath "${source}")
home=$(dirname "${source}")main() {
docker run -v "${home}":/project \
-w /project --rm -e TARGET \
-v /var/run/docker.sock:/var/run/docker.sock \
docker:18.09-dind sh -c '#!/usr/bin/env shset -xset -euo pipefailapk add curlcurl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -ysource "${HOME}/.cargo/env"# building on release is slowapk add libgcc gcc musl-devcargo test --workspacecargo install --path . --force --debugexport CROSS_CONTAINER_IN_CONTAINER=1apk add gittd="$(mktemp -d)"git clone --depth 1 https://github.com/cross-rs/rust-cpp-hello-word "${td}"cd "${td}"cross run --target "${TARGET}" --verbosetd="$(mktemp -d)"git clone --depth 1 https://github.com/cross-rs/test-workspace "${td}"cd "${td}"cross build --target "${TARGET}" --workspace \ --manifest-path="./workspace/Cargo.toml" --verbosecd workspacecross build --target "${TARGET}" --workspace --verbosecd binarycross run --target "${TARGET}" --verbose'
}
main
Output
/usr/local/bin/docker run --userns host -e 'PKG_CONFIG_ALLOW_CROSS=1' -e 'XARGO_HOME=/xargo' -e 'CARGO_HOME=/cargo' -e 'CARGO_TARGET_DIR=/target' -e 'CROSS_RUNNER=' -e 'USER=root' -v /tmp/tmp.hppfjI/external/external_lib:/tmp/tmp.hppfjI/external/external_lib --rm --user 0:0 -v /var/lib/docker/overlay2/4f20476a48228131897c42ce45df9e9ef74864fc590040ebfa4bce7f086f375e/merged/root/.xargo:/xargo:Z -v /var/lib/docker/overlay2/4f20476a48228131897c42ce45df9e9ef74864fc590040ebfa4bce7f086f375e/merged/root/.cargo:/cargo:Z -v /cargo/bin -v /var/lib/docker/overlay2/4f20476a48228131897c42ce45df9e9ef74864fc590040ebfa4bce7f086f375e/merged/tmp/tmp.hppfjI/workspace:/var/lib/docker/overlay2/4f20476a48228131897c42ce45df9e9ef74864fc590040ebfa4bce7f086f375e/merged/tmp/tmp.hppfjI/workspace:Z -v /var/lib/docker/overlay2/4f20476a48228131897c42ce45df9e9ef74864fc590040ebfa4bce7f086f375e/merged/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu:/rust:Z,ro -v /var/lib/docker/overlay2/4f20476a48228131897c42ce45df9e9ef74864fc590040ebfa4bce7f086f375e/merged/tmp/tmp.hppfjI/workspace/target:/target:Z -w /var/lib/docker/overlay2/4f20476a48228131897c42ce45df9e9ef74864fc590040ebfa4bce7f086f375e/merged/tmp/tmp.hppfjI/workspace ghcr.io/cross-rs/aarch64-unknown-linux-gnu:0.2.2 sh -c 'PATH=$PATH:/rust/bin cargo build --target aarch64-unknown-linux-gnu --workspace --verbose'
error: failed to load manifest for workspace member `/var/lib/docker/overlay2/4f20476a48228131897c42ce45df9e9ef74864fc590040ebfa4bce7f086f375e/merged/tmp/tmp.hppfjI/workspace/binary`
Caused by:
failed to load manifest for dependency `test-workspace`
Caused by:
failed to load manifest for dependency `external_lib`
Caused by:
failed to read `/var/lib/docker/overlay2/4f20476a48228131897c42ce45df9e9ef74864fc590040ebfa4bce7f086f375e/merged/tmp/tmp.hppfjI/external/external_lib/Cargo.toml`
Caused by:
No such file or directory (os error 2)
We can see that external_lib is mounted at /tmp/tmp.hppfjI/external/external_lib:/tmp/tmp.hppfjI/external/external_lib , and not at /var/lib/docker/overlay2/4f20476a48228131897c42ce45df9e9ef74864fc590040ebfa4bce7f086f375e/merged/tmp/tmp.hppfjI/test-workspace/external/external_lib/. Likewise, we only mount workspace, and not test-workspace.
Additional information / notes
No response
The text was updated successfully, but these errors were encountered:
Checklist
Describe your issue
When running docker-in-docker, if using a workspace and not at the root directory, the mounted volumes in the workspace are not properly adjusted to the the mounted prefix. This is because
docker_mount
does not use the mount finder.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.2 (00c1de2)
Example
While testing the integration tests in #873, the following script fails, producing the subsequent output:
Script
Output
We can see that
external_lib
is mounted at/tmp/tmp.hppfjI/external/external_lib:/tmp/tmp.hppfjI/external/external_lib
, and not at/var/lib/docker/overlay2/4f20476a48228131897c42ce45df9e9ef74864fc590040ebfa4bce7f086f375e/merged/tmp/tmp.hppfjI/test-workspace/external/external_lib/
. Likewise, we only mountworkspace
, and nottest-workspace
.Additional information / notes
No response
The text was updated successfully, but these errors were encountered: