Difficulty: Beginner
Estimated Time: 10 minutes

There are two ways of approaching stateful Containers, that is containers are store and persistent data for future use. This could be the container creating and storing data, for example, a database. Alternatively, it could be data requiring additional for instance the configuration or SSL certifications. This approach can also be used to backup data or debug containers.

One approach we've discussed is using the -v <host-dir>:<container-dir> option to map directories. The other approach is to use Data Containers. This scenario will introduce the advantages of using Data Containers.

This scenario has explained how to use Data Containers. Data Containers are a great way of managing configuration data which can be used by other containers. The volumes-from property allows us to gain access to other containers volumes which we can utilise for debugging or backup purposes.

Data Containers

Step 1 of 4

Step 1 - Create Container

Data Containers are containers whose sole responsibility is to be a place to store/manage data.

Like other containers they are managed by the host system. However, they don't run when you perform a docker ps command.

To create a Data Container we first create a container with a well-known name for future reference. We use busybox as the base as it's small and lightweight in case we want to explore and move the container to another host.

When creating the container, we also provide a -v option to define where other containers will be reading/saving data.

Task

Create a Data Container for storing configuration files using docker create -v /config --name dataContainer busybox

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]