Exercise Solution

In this lesson, we will go over the step-by-step solution for the exercise: Publish an Image and Run a Container on Another Machine.

  • Head to https://hub.docker.com/ with a browser and click the Sign Up link.

  • Create an account with the Docker ID you wish. For the rest of this solution, we’ll suppose it is learnbook, but you can replace it with your own.

  • The following commands will push the jsparam image onto your docker hub repository.

The following commands will start two containers that will display the area according to the specified value of the diameter environment variable.

Connect the below terminal to display the output of the above commands. You can try to change the value of the diameter variable and observe how the output changes.

You can also test the above commands with your own docker ID in the terminal provided below.

Terminal 1
Terminal

Click to Connect...

The output would display the area with both diameter values.


Let’s move on to private registries in the next lesson.

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