Examples of Using Container Images in Practice

Overview

Teaching: 20 min
Exercises: 0 min
Questions
  • How can I use Docker for my own work?

Objectives
  • Use existing container images and Docker in a research project.

Now that we have learned the basics of working with Docker images and containers, let’s apply what we learned to an example workflow.

You may choose one or more of the following examples to practice using containers.

Jekyll Website Example

In this Jekyll Website example, you can practice rendering this lesson website on your computer using the Jekyll static website generator in a Docker container. Rendering the website in a container avoids a complicated software installation; instead of installing Jekyll and all the other tools needed to create the final website, all the work can be done in the container. Additionally, when you no longer need to render the website, you can easily and cleanly remove the software from your computer.

GitHub Actions Example

In this GitHub Actions example, you can learn more about continuous integration in the cloud and how you can use container images with GitHub to automate repetitive tasks like testing code or deploying websites.

Using Containers on an HPC Cluster

It is possible to run containers on shared computing systems run by a university or national computing center. As a researcher, you can build and test your container on your own computer and then use it to run your full-scale computing work on a shared computing system like a high performance cluster or high throughput grid.

The catch? Most university and national computing centers do not support running containers with Docker commands, and instead use a similar tool called Singularity or Shifter. However, both of these programs can be used to run Docker container images, so often people create their container as a Docker container image, so they can run it using either of Docker or Singularity.

We will see examples of how to run containers on an HPC system in day two of this workshop. This will include pulling images from Docker Hub.

Seeking Examples

Do you have another example of using Docker in a workflow related to your field? Please open a lesson issue or submit a pull request to add it to this episode and the extras section of the lesson.

Key Points

  • There are many ways you might use Docker and existing container images in your research project.