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

Linux: Docker build containers fail to access bind mount on certain systems #207

Open
nicholas-rh opened this issue Jul 28, 2023 · 0 comments

Comments

@nicholas-rh
Copy link

When building using the package-specific docker container setup, I get the following error:

docker run --platform linux/amd64 --tty -v /home/user1/repos/3p-package-source/package-system/OpenSSL/temp:/data/workspace/temp:ro openssl_1_1_1t_amd64_3p:latest /data/workspace/docker_build_openssl.sh
Preparing source folder '/data/workspace/src'
cp: cannot stat '/data/workspace/temp/src': Permission denied
Error copying src from /data/workspace/tempo
Failed to build from docker image openssl_1_1_1t_amd64_3p:latest
To log into and troubleshoot the docker container, run the following command:

docker run --platform linux/amd64 -v /home/user1/repos/3p-package-source/package-system/OpenSSL/temp:/data/workspace/temp:ro -it --tty openssl_1_1_1t_amd64_3p:latest

Error executing custom build command ./build-linux.sh openssl_1_1_1t 18.04 x86_64
Package OpenSSL-1.1.1t-rev1-linux failed to build from source.

This seems to be a SELinux related issue, because when I add "Z" to the list of bind mount options like docker run --platform linux/amd64 --tty -v /home/user1/repos/3p-package-source/package-system/OpenSSL/temp:/data/workspace/temp:ro,Z , the problem is fixed:

https://docs.docker.com/storage/bind-mounts/#configure-the-selinux-label

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

1 participant