-
Notifications
You must be signed in to change notification settings - Fork 40
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
Improve Dockerfile to Handle Permissions and Enhance Build Compatibility #814
Comments
@DonRichards excellent issue, thanks. I'll test the PR and docs this weekend. |
Running this as indicated on my M2 Mac with the latest Docker For Mac, I get
However, if I change line 33 of the Dockerfile to |
@noahwsmith I'm also seeing the chown failure on my Mac. |
I'd love to hear about some use cases for using the dockerfile. I think they would make an excellent addition to the Workbench docs. |
@mjordan I just put in a PR to the Islandora Documentation for how to use it to populate a site template site - Islandora/documentation#2351 |
Cool, thanks. I'll point to this from the new docs @DonRichards contributed to the workbench docs. |
Problem:
The current Dockerfile in the repository has encountered several minor warnings related to compatibility with different host environments and is running pip installs as root. This isn't "good practice". Additionally, there are challenges related to BuildKit and ensuring consistent user and group ID handling between the host and the Docker container. And remove the need to use
DOCKER_BUILDKIT=0
in most situations.Solution:
To resolve these issues, the following enhancements should be made to the Dockerfile:
User and Group ID Handling: Introduce build arguments
USER_ID
andGROUP_ID
to ensure that the Docker container runs with the same user and group IDs as the host system. This will prevent permission issues when the container interacts with mounted directories.Permission Management: Add a step in the Dockerfile to create a group with the specified
GROUP_ID
and ensure proper ownership and permissions are set for the/workbench
directory within the container.Environment Variable Update: Modify the Dockerfile to include the
.local/bin
directory in thePATH
, ensuring that scripts installed viapip
are accessible during runtime.DOCKER_BUILDKIT=0 Consideration: Provide documentation on why and when to disable BuildKit by setting
DOCKER_BUILDKIT=0
, to ensure compatibility and address any issues that might arise from using the legacy build system. This will be a PR to the docs repo.Steps to Reproduce:
Build the Docker Image:
docker build -t workbench-docker .
Run the Docker Container:
Observe:
Expected Behavior:
Additional Context:
This improvement will enhance the usability and flexibility of the Islandora Workbench when running in Docker, particularly for users who need to work with files in various directories on their host systems. I'm submitting a PR in a moment.
The text was updated successfully, but these errors were encountered: