Introduction to Docker

An opinionated introduction to using Docker as a software development tool. Presented at the February 2020 Analysis Preservation Bootcamp at CERN.

Originally developed by Matthew Feickert for the 2019 USATLAS Computing Bootcamp at LBNL.

Prerequisites

Basic knowledge of the Unix Shell, e.g., from the carpentry course

HSF Software Training

HSF Logo
This training module is part of the HSF Software Training Center, a series of training modules that serves HEP newcomers the software skills needed as they enter the field, and in parallel, instill best practices for writing software.

Schedule

Setup Download files required for the lesson
00:00 1. Introduction What are containers?
00:10 2. Pulling Images How are images downloaded?
How are images distinguished?
00:25 3. Running Containers How are containers run?
How do you monitor containers?
How are containers exited?
How are containers restarted?
00:45 4. File I/O with Containers How do containers interact with my local file system?
01:05 5. Writing Dockerfiles and Building Images How are Dockerfiles written?
How are Docker images built?
01:35 6. Removal of Containers and Images How do you cleanup old containers?
How do you delete images?
01:45 7. Coffee break Coffee or tea?
02:00 8. Gitlab CI for Automated Environment Preservation How can gitlab CI and docker work together to automatically preserve my analysis environment?
What do I need to add to my gitlab repo(s) to enable this automated environment preservation?
02:45 9. Running our Containerized Analysis How do I run my full analysis chain inside docker containers?
03:30 10. Optional: Running Containers on LXPLUS Using Singularity How can I run a container on LXPLUS?
03:45 11. Bonus: Using CMD and ENTRYPOINT in Dockerfiles How are default commands set in Dockerfiles?
03:45 12. Bonus Episode: Building and deploying a Docker container to Github Packages How to build a Docker container for python packages?
How to share Docker images?
04:25 Finish

The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.

Authors

The following people contributed to the content of this lesson: Note that this list does not include the contributors to the framework as developed by the carpentries.