In the previous recipe, we successfully created our Docker image in the Docker host. Keep in mind that if you are using Windows or Mac, your Docker host is the VirtualBox VM and not your local computer. In this recipe, we will look at how to spin off a container for the newly created image.
To spin off a new container for our packt/geolocation
image, we will use the docker run
command. This command is used to run any command inside your container, given the image. Open your terminal and go to the root of the geolocation project. If you have to start your Docker machine instance, then do so by using the docker-machine start
command, and set the environment using the docker-machine env
command.