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 Dockerfile and docker build: how your app becomes an image

What happens when you put your app in a Docker container

Docker registry: how your image gets to the server

You build a Docker image on your laptop. It has to run on a server that you may never touch. How does the image get there? And where did the Python inside it come from?

  1. 1 In fact, one image already made that trip. During the build, the base image with Python came down to your laptop from a shared store of images on the internet, called a registry.registryPythonyour laptop

    In fact, one image already made that trip. During the build, the base image with Python came down to your laptop from a shared store of images on the internet, called a registry.

  2. 2 Yours can take the same road, the other way. You give it a name and a version label called a tag, here 1.0. Then docker push sends a copy up to the registry, and your laptop keeps its own.registryPythonimage1.0your laptopimagedocker push

    Yours can take the same road, the other way. You give it a name and a version label called a tag, here 1.0. Then docker push sends a copy up to the registry, and your laptop keeps its own.

  3. 3 Over on the server, docker pull asks the registry for the same name and tag. A copy comes down, and now the server has your image too.registryPythonimage1.0the serverimage1.0docker pull

    Over on the server, docker pull asks the registry for the same name and tag. A copy comes down, and now the server has your image too.

  4. 4 Rono is glad to see it there, with everything your app needs inside. Yet nothing runs, because nobody has started the image.RonoIs iton air?the serverimage1.0

    Rono is glad to see it there, with everything your app needs inside. Yet nothing runs, because nobody has started the image.

  5. Quick check

    Before the show, you see a spelling mistake on the request page.You fix it andbuild again. Does theserver get the fixby itself?

    Before the show, you see a spelling mistake on the request page.

    Show the answer

    No. The new image is only on your laptop. You push it to the registry, and then the server pulls it.

  6. Go further

    The registry you used, and a few words that go with it.registryDocker Hubthe public registry yourbase image came fromimageimage1.01.1repositoryone image name in aregistry, with all its tagslatestlatest tagthe tag Docker addswhen you give none

    The registry you used, and a few words that go with it.

Next episode docker run: what a container really is on the server

Share this comic

More comics