Running a Docker container (RabbitMQ)
In this recipe we learn how to run a docker image, thereby making a container.
Getting ready
We will start the RabbitMQ container image that we downloaded in the previous recipe. This process is representative of how many containers are run, so it makes a good example.
How to do it
We proceed with the recipe as follows:
- What we have downloaded so far is an image that can be run to create an actual container. A container is an actual instantiation of an image with specific parameters needed to configure the software in the container. We run the container by running an image using docker run and passing the image name/tag, and any other parameters required to run the image (these are specific to the image and normally can be found on the Docker Hub page for the image). The specific command we need to run RabbitMQ using this image is the following:
$ docker run -d -p 15672:15672 -p 5672:5672 rabbitmq:3-management 094a138383764f487e5ad0dab45ff64c08fe8019e5b0da79cfb1c36abec69cc8...