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

Add the --workdir option to the Docker Singularity container command line #24

Open
jcohen02 opened this issue Aug 18, 2021 · 1 comment
Assignees
Labels
type:enhancement Propose enhancement to the lesson

Comments

@jcohen02
Copy link
Collaborator

Based on a suggestion from a participant at a recent run of a course based on this material, look at adding the --workdir (or -w) command to the Docker command line to remove the need to use the full /home/singularity path in front of all the files we reference.

At present, when using the Docker Singularity container, we bind mount ${PWD}, the current working directory, into the Docker container at the location /home/singularity. We then want to reference files in that location to read input and write output to a location where the files are still accessible after the Docker Singularity container has exited. This is currently done by prefixing every file with /home/singularity but that lengthens the command line and may be a little confusing to course participants.

As an alternative, if we add -w /home/singularity to the command line, then the working directory within the container is set to this location and it's no longer necessary to prefix references to files in this location with /home/singularity.

@jcohen02 jcohen02 self-assigned this Aug 18, 2021
@jcohen02 jcohen02 added the type:enhancement Propose enhancement to the lesson label Aug 18, 2021
@jcohen02
Copy link
Collaborator Author

This change will affect material in the following episodes:

If all the command line examples in the above episodes are edited to remove /home/singularity/ from the front of filenames, this will hide some of the complexity but will it also add some confusion? For example, if we update the alias shown in 06-singularity-images-prep.md to include -w /home/singularity, and then remove /home/singularity from subsequent command line examples, are we simply obscuring some operational details and making it more difficult for learners to understand what's going on when they try to use the material covered here in their own container building processes?

Given that it's useful to highlight the option of using the -w switch, for now, the solution being taken to address this issue is to add a note box into 06-singularity-images-prep.md to highlight the option of using -w or --workdir.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Propose enhancement to the lesson
Projects
None yet
Development

No branches or pull requests

1 participant