-
Notifications
You must be signed in to change notification settings - Fork 570
Development within Containers
How to get your code into a container
Adding tools to a container
- YUM - You are root within a container, so you may add anything from the UBI yum repositories
yum install vim
- Spack - Our containers use Spack to set up most of the third-party software, so adding any desired package to the active Spack environment will allow you to install it
spack install --add ddt
- Caveat: A container is ephemeral. Once the container is stopped and removed, you will lose the installed software. If you wish to add software in a persistent manner
- Contact [email protected] to request additional software be added to container recipes, which will add them to the images that are published in the registry
- [TODO: Add instructions for layering an image on top of one of ours (maybe in the basics section?)]
As mentioned above, due to containers being ephemeral instances, any files created, modified, or removed within the container will be lost once the container instance is shut down. This can be a pain if you are trying to use a container as a development environment as you may need to utilize the same files between container instances or between the container and host machine.
With most container engines there are two solutions to this problem, creating a container volume visible on the host machine, or bind mounting a directory from the host machine to the container directly.
For a more in-depth explanation of these two solutions, see the following recommended documentation:
- Official Docker documentation on storage volumes
- Official Docker documentation on bind mounts
- Volumes vs. bind mounts
In this case, we will recommend bind mounting as it is the more simpler approach. All that is required is an absolute path to a workspace directory on the host machine.
docker run --rm -it --mount type=bind,src=${HOME}/Trilinos,dst=/root/Trilinos <some_image_here>
In this example, ${HOME}/Trilinos
is the directory on the host machine we want to make visible inside the container at its /root/Trilinos
path. Any files created, modified, or removed here will persist through the host machine and through future containers launched with the same mounted paths.
Copyright © Trilinos a Series of LF Projects, LLC
For web site terms of use, trademark policy and other project policies please see https://lfprojects.org.
Trilinos Developer Home
Trilinos Package Owners
Policies
New Developers
Trilinos PR/CR
Productivity++
Support Policy
Test Dashboard Policy
Testing Policy
Managing Issues
New Issue Quick Ref
Handling Stale Issues and Pull Requests
Release Notes
Software Quality Plan
Proposing a New Package
Guidance on Copyrights and Licenses
Tools
CMake
Doxygen
git
GitHub Notifications
Mail lists
Clang-format
Version Control
Initial git setup
'feature'/'develop'/'master' (cheatsheet)
Simple centralized workflow
Building
SEMS Dev Env
Mac OS X
ATDM Platforms
Containers
Development Tips
Automated Workflows
Testing
Test Harness
Pull Request Testing
Submitting a Pull Request
Pull Request Workflow
Reproducing PR Errors
Addressing Test Failures
Trilinos Status Table Archive
Pre-push (Checkin) Testing
Remote pull/test/push
PR Creation & Approval Guidelines for Tpetra, Ifpack2, and MueLu Developers