Difficulty: Beginner
Estimated Time: 10 minutes

See the differences when running something in a container than running it "normally".

A process running in a container is isolated in many perspectives:

  • Cgroup
  • File system
  • Network namespace
  • etc.

In this scenario we're going to use a docker image called alpine.

We'll come to the real meaning of a image in a later scenario. For now it should be enough knowing that everything starts with "docker run alpine:latest" is run inside a container.

We've covered some (probably) most widely mentioned perspectives of how a container can provide isolation on processes.

  • Cgroup
  • File system
  • Network namespace

There're actually more to explore, for example the user ID namespace. We'll discover more about it in the next scenario.

Don’t stop now! The next scenario will only take about 10 minutes to complete.

I. Container: First Contact

Step 1 of 4

1. Create your first container

A simple command

First let's run a simplest shell command: echo "Hello Docker!"

Now we run the same command again, but with Docker: docker run alpine:latest echo "Hello Docker!"

Doesn't look different in anyway, does it? That's how a container is supposed to be, just to wrap and isolate a process, without changing how the process behaves.

But what's the point of all this if running inside a container doesn't make any difference?

In the following steps we're going to run something different, to see a bit more.