-
Notifications
You must be signed in to change notification settings - Fork 2
Working with Docker
hdpm
uses Docker as a tool for packaging Linux binaries for CentOS 6/7, Ubuntu 14, and Fedora 22. sim-recon and its dependencies are built inside a Docker container, starting from a Linux-distribution base image, and then the relevant binaries are extracted into a tarfile. The Dockerfiles and scripts used to carry this out are located in the "docker" directory. The images resulting from these builds are publicly available at either Docker Hub or Quay. At Docker Hub, there is one repository for dependencies (sim-recon-deps) and one for an automated build of sim-recon (sim-recon). There is another sim-recon-deps repository at Quay that holds additional Linux-distribution tags. The available tags at each repository are listed below.
Follow the instructions for your operating system at https://docs.docker.com/engine/installation/.
docker pull quay.io/nathansparks/sim-recon-deps:<tag>
- tags:
centos6
andcentos7
docker pull nathansparks/sim-recon-deps:<tag>
- tags:
ubuntu14
andfedora22
docker pull nathansparks/sim-recon
- tags:
latest
(CentOS-7)
Create a more convenient (shorter) <name>:<tag>
for the image by running
docker tag nathansparks/sim-recon sim-recon
The command for running a container can grow very long; it is useful to wrap it in a bash function. In the "docker" directory, there is a script called "shortcuts.sh". Make a directory to use for mounting data into a running container, and source the shortcuts script:
cd <path_to_hdpm>/docker && mkdir data
- Switch to a
bash
shell if needed. source shortcuts.sh
To run the software, precede the usual command with the bash function dock
. Multi-word commands must be enclosed in quotes. Move or copy any input-data and config. files into the "data" directory for mounting. Output files will be written to this directory as well.
dock "hd_root --config=parms.config hd_rawdata_003185_000.evio"
Docker can also be used as a tool for developing sim-recon. First, setup a directory with the source code to be developed and a Dockerfile for building it:
cd <path_to_hdpm>/docker/buildfiles && mkdir dev && cd dev
git clone https://github.com/JeffersonLab/sim-recon
cp -p ../centos7/Dockerfile .
- Edit the Dockerfile to add your source code when building the image.
- Delete or modify the MAINTAINER line.
- Insert the following lines following the MAINTAINER or FROM line.
USER root
ADD sim-recon pkgs/sim-recon
RUN chown -R hdpm:hdpm pkgs/sim-recon
USER hdpm
Develop sim-recon, and then build it in a container by running
docker build -t sim-recon:dev .