You are signed in. Close

You are signed out. Close

Thank you. Your subscription has started. Close

Thank you. You will get an email when a new comic comes out. Close

We could not confirm your payment. If you paid, use the link "Sign in" at the bottom of the page. Close

Something went wrong on our side. Please try again in a moment. Close

Previous episode Docker registry: how your image gets to the server

What happens when you put your app in a Docker container

docker run: what a container really is on the server

Everyone calls it a container. The name makes it sound like a small computer hidden inside a server. Type docker run, then look at what really starts.

  1. 1 Your image waits on the server. Before Miva taps anything, it has to start. Watch closely: what starts may surprise you.One command.Then we look forwhat it started.

    Your image waits on the server. Before Miva taps anything, it has to start. Watch closely: what starts may surprise you.

  2. 2 You type docker run on the server, and your app starts from the image, with everything it needs inside. Each running copy of an image is called a container.the serverimagedocker runcontainerRequestsopen!

    You type docker run on the server, and your app starts from the image, with everything it needs inside. Each running copy of an image is called a container.

  3. 3 The name makes it sound like a little computer hidden inside the server. But a computer takes time to start, and this one was running the moment you asked.youA little computerinside the server?containerNo waiting:I'm running!

    The name makes it sound like a little computer hidden inside the server. But a computer takes time to start, and this one was running the moment you asked.

  4. 4 So what is it, really? The server keeps a list of every program it runs, called its processes. Your app, in its container, is simply one more process on that list, next to the server's own.processes on the serverremote logintimerDockeryour appcontainer

    So what is it, really? The server keeps a list of every program it runs, called its processes. Your app, in its container, is simply one more process on that list, next to the server's own.

  5. 5 Show time, and Miva opens the request page with a song in mind. Your container runs on the server, yet her phone can't reach it. Why?MivaWhere's therequest page?This sitecan't bereached

    Show time, and Miva opens the request page with a song in mind. Your container runs on the server, yet her phone can't reach it. Why?

  6. Quick check

    While Miva waits, you try once more.Same image,docker runtwice. How manynew processes?

    While Miva waits, you try once more.

    Show the answer

    Two. Each container here is one process, and both come from the same image.

  7. Go further

    More words for the programs on the server's list.processa program whileit runsIDprocess IDthe number Linuxgives each processDockerdaemona program that runsin the background.Docker itself is one

    More words for the programs on the server's list.

Next episode Linux namespaces: why a container thinks it is alone

Share this comic

More comics