Running your microservice inside a Docker container
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.
Getting ready
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 ...
Get Microservices Deployment Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.