Move sourcing environment to chroot during build #1065
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the Pull Request (PR):
Some time ago we began sourcing
/.singularity.d/env/90-environment.sh
during build before entering the%post
section. This works fine for simple variable declaration, but since we do this outside of the chroot environment other things can break. For instance, if/.singularity.d/env/90-environment.sh
is sourcing another script (/etc/profile
for example) it will source the script on the host system instead of the one inside the container.Here I'm moving the sourcing of the environment into the chrooted %post section. I'm doing so by prepending the sourcing commands to the recipe file on behalf of the user at build time. I'm also adding the complete loop so that all
*.sh
files in/.singularity.d/env/
are properly sourced.This fixes or addresses the following GitHub issues:
Checkoff for all PRs:
✅ I have read the Guidelines for Contributing, and this PR conforms to the stated requirements.
make test
✅ This PR is NOT against the project's master branch
✅ I have added myself as a contributor to the contributors's file
✅ This PR is ready for review and/or merge
Attn: @singularityware-admin