Skip to content

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

Description

@nicholas-rh

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions