1505004 : Access /data from docker container¶
Created: 2025-05-22T16:36:18Z - current status: open¶
Summary: A user is experiencing issues accessing data outside their container. They are using a script to run a Docker container with specific bindings, but they can only access data in /afs and not in /data. They need to access a script located in /data/dust/user/[USERNAME]/MCSimulationTiming/startRuns.sh but are currently unable to do so.
Solution: The issue might be related to the way the container is mounted or the permissions set for the /data directory. To resolve this, you can try the following steps:
-
Verify Bind Mounts: Ensure that the
/datadirectory is correctly mounted inside the container. The script already includes--bind /data:/data, but double-check that this mount is effective. -
Check Permissions: Verify that the user running the container has the necessary permissions to access the
/data/dust/user/[USERNAME]/MCSimulationTiming/startRuns.shfile. -
Use Absolute Paths: Make sure that the path to the script inside the container is correct and absolute. Sometimes relative paths can cause issues.
-
Apptainer Specific Flags: If using Apptainer, consider using the
--no-homeflag to ignore the home directory and explicitly mount/afsas suggested in the known issues documentation. This might help in resolving mount-related issues. -
Debugging: Run the container interactively to debug the issue. You can use
apptainer exec --contain --bind /afs:/afs --bind /nfs:/nfs --bind /data:/data --bind /pnfs:/pnfs --bind /cvmfs:/cvmfs --bind /var/lib/condor:/var/lib/condor --pwd </working/directory/of/job> <your-singularity-args> </path/singularity:image> <your executable and args>to start an interactive session and check the mounted directories. -
Alternative Methods: Consider using an interactive job submission with
condor_submit -ito log into the Apptainer job container for further debugging.
References: 1. https://docs.desy.de/naf/documentation/questions_answers/container_run_error 2. https://docs.desy.de/naf/documentation/apptainer-support-bird 3. https://docs.desy.de/naf/documentation/container-from-other-hubs