Skip to content

Developing inside a container

John Freeman edited this page Dec 4, 2024 · 5 revisions

JCF, Dec-4-2024: You may need to have a computer with an Intel processor for this to work

If you wish to do your development in a docker container, you have two options: one is to use the image in which the nightly is built, and which contains a copy of /cvmfs inside of it. Another is to use a base Alma 9 image and volume mount /cvmfs into it. Each has its advantages and disadvantages; for example, the first option seems to work more reliably under more circumstances, but involves a much larger image than the second option. Note that one potential failure mode is to have a ~/.spack directory set up by Spack in your home area, which can interfere with operations. To develop using the full nightly image out of their home directory, a user can execute the following on a system which has Docker available:

docker pull ghcr.io/dune-daq/nightly-release-alma9:development_v5  # Gets an image containing the most recent successful nightly release
docker run -it --name my-dev-container --volume $HOME:$HOME:shared -e HOME=$HOME --workdir $HOME  ghcr.io/dune-daq/nightly-release-alma9:development_v5

and then once inside the container, you can develop normally, with the caveat that the only nightly available will be the one associated with the image. When you're done developing, you can exit out of the container, and if you want to pick up where you left off, you can use the standard Docker commands:

docker start my-dev-container
docker attach my-dev-container

Note, of course, that you can choose a different (and possibly better) name than my-dev-container.

To use a simple Alma 9 image and volume mount /cvmfs into it, a user can execute the following:

docker pull ghcr.io/dune-daq/alma9-spack
docker run -it --name my-dev-container --volume /cvmfs:/cvmfs:shared  --volume $HOME:$HOME:shared -e HOME=$HOME --workdir $HOME  ghcr.io/dune-daq/alma9-spack