Having a MongoDB or RabbitMQ container is useful when you need those services up and running for your application.
But what happens when you need to modify the service in that container? Maybe you need to add a new user to the MongoDB instance. Or you want to automate the RabbitMQ configuration with a script. If everything is in the container, and you don't have the tools for the service installed on your computer, how do you configure things?
Docker “exec” allows us to execute any command we want, against a container as if it were a full virtual machine. We can run “mongo” or “rabbitmqctl”, for example, and we can even get into a full shell with interactivity, in some containers.
In this episode, you'll learn how to execute commands against your container, as if you were running the service directly on your computer.