Difficulty: beginner
Estimated Time: 8-10 minutes

Welcome to the Basics of Docker.

You will learn how to run the most often used commands in day to day work with docker.

Congratulations! You can start the next exercise in this series.


Step 1 of 3

Launching a container

Launching a container

To launch a container in docker we specify the following

docker run -d nginx

The -d means run in detached mode.

This doesn't allow us to access our nginx instance though as we didn't expose it!

Let's try again:

docker run -d -p 8081:80 nginx

Now you should be able to access the basic html website with:

curl docker:8081

To see currently running containers run:

docker ps

If you want to see the whole output:

docker ps --no-trunc