Run an Image on Another Machine

In this lesson, you will get a chance to run the image we published in the previous lesson on a machine where the image wasn't created.

This is a straightforward process. In fact, you already know how to do this; use the docker run command. Alternatively, get the image with docker pull then use it with docker run. This would be useful in case you plan to disconnect from the internet before running a container, for instance.

You can try it on your machine with Docker Engine or Docker Desktop installed. Run the following command:

Then open your browser and head to the following URL in order to see my web page being served over HTTP by that container.

http://localhost:8085

Isn’t that neat? A painless delivery system.

There’s a little variance to this. If you want to run an image that is stored in a private registry, you first need to log into the registry using the docker login command. Once this is done, you can docker pull the image. Should you want to run another container with that image later on, you don’t need to log in since the image is stored on your machine.


Before we move on to private registries, try the exercise in the next lesson.

Docker Hub
Exercise: Publish an Image and Run a Container on Another Machine
Mark as Completed
Report an Issue