Let's go back a little and begin with the basics: how to run and stop the Docker container manually, from the shell or the command line.
Starting and stopping containers
Starting
As you have seen in the previous chapters, to spin-up the container from the image, we use the docker run command. The running container will have its own file system, networking stack, and isolated process tree separate from the host. As you will remember from Chapter 5, Creating Images with Java Applications, every single docker run command creates a new container and executes a command specified in the Dockerfile, CMD, or ENTRYPOINT.
The syntax of the docker run command is as follows:
$ docker run [OPTIONS] IMAGE[:TAG|@DIGEST] [COMMAND] [ARG...