Running and stopping a container

The first Docker command that is usually run after installation is docker run. As you may remember, this command is one of the most commonly used in previous examples. This command does two things: it pulls and downloads the image definition from the registry, in case it is not cached locally, and starts the container. There are many options that can be set for this command, which you can easily check by running docker run --help. Some options have one-letter shortcuts, which are often the most commonly used options. Option –d runs a container in the background, while –i keeps stdin open even if it is not attached. If your container has to expose any ports outside, you can use the activate option –p with the ...

Get Mastering Spring Cloud 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.