Table Of Contents
Table Of Contents

Getting Started with Docker

Last Updated: November 2021

To get started using Docker, you'll first need to install it. Docker provide excellent documentation for installation that can be found here: Get Docker | Docker Documentation. This guide provides shortcuts to installation instructions that are most relevant to Tethys app developers.

Install

Use the appropriate instructions below to install Docker:

Linux

Docker provides installation instructions for the most popular Linux distributions including (CentOS, Debian, Fedora, Raspbian, RHEL, SLES, and Ubuntu). It should be possible to install it on other Linux distributions. As we recommend deploying Tethys Platform on either CentOS or Ubuntu, links to the installation instructions for these two distributions are provided below:

Notes:

  • We recommend using the Install using the repository method.

  • If you intend to use the tethys docker command or if you'd like to use it without sudo, you'll need to complete the Manage Docker as a non-root user post-installation step as well.

Windows and Mac

On Windows and Mac you will install Docker Desktop, which provides a graphical user interface for Docker (Figure 1). It also includes the commandline Docker client and on Windows you have the ability to switch between running Linux and Windows docker containers.

Screenshot of Docker Desktop on Windows.

Figure 1: Screenshot of Docker Desktop on Windows.

Use one of the links below to install Docker Desktop on Windows or Mac:

Verify Installation

After installing Docker Desktop, you should be able to use the docker command on the command prompt/terminal as you would in Linux. Create the docker/getting-started container to verify the installation as follows:

docker run -d -p 80:80 docker/getting-started

Note

When you run a container, the Docker daemon automatically assigns the container a random human readable name of the form <adjective>_<noun>. For example "angry_grothendieck". You can also specify a name using the --name option. Just remember that the name needs to be unique among the containers running on your system.

docker run --name my_first_container -d -p 80:80 docker/getting-started

The docker run command will automatically pull (download) the docker/getting-started image if it hasn't been pulled already and then create and start the container. The docker/getting-started image contains a website with a tutorial for Docker (Figure 2). To view the tutorial open a web browser and navigate to http:localhost.

Screenshot of the Getting Started tutorial website running in the getting-started container.

Figure 2: Screenshot of the Getting Started tutorial website running in the getting-started container.

Tutorial

If you are new to Docker, we highly recommend completing the Getting Started tutorial that is now running Docker (see previous step). You can also access the tutorial on Docker's website: Orientation and setup | Docker Documentation. In this tutorial you will learn the following important concepts: