Difficulty: Beginner
Estimated Time: 10 minutes

In this lab, we will learn how to use host mounts as a volume.

Docker Host Mounts

Host Mounts

In this lab, we will learn how to use host mounts as a volume.

  • Run a container with attached host volume, since docker is running on a remote host we will mount a volume to the container and create a file. If running locally you can mount a local directory in the same manner. docker container run -d -v ~/myloc:/myloc --name mycontainer1 ubuntu bash -c "touch /myloc/hello.txt" The -v flag is for volume. What are the other new flags?

  • The container is still stopped docker container ls -a

  • View the mounted file in the container and exit: docker container run --rm -it -v ~/myloc:/myloc --name mycontainer2 alpine ls /myloc

This tab will not be visible to users and provides only information to help authors when creating content.

Creating Katacoda Scenarios

Thanks for creating Katacoda scenarios. This tab is designed to help you as an author have quick access the information you need when creating scenarios.

Here are some useful links to get you started.

Running Katacoda Workshops

If you are planning to use Katacoda for workshops, please contact [email protected] to arrange capacity.

Debugging Scenarios

Below is the response from any background scripts run or files uploaded. This stream can aid debugging scenarios.

If you still need assistance, please contact [email protected]