February 2018
Intermediate to advanced
200 pages
5h 51m
English
In the preceding task, we created and started a Docker container using the parameter state. If we set state as present, it will only create a container and will not start it. We are using the command parameter with the value sleep infinity to keep our container running. Docker containers will exit if the foreground process exits. The command sleep infinity ensures that the foreground process runs till infinity (theoretically, of course).
Once the Docker container was ready, we used a Docker command to look at the running containers. The command then gave us a list of the running containers; after that, we executed the ls command in our Docker container.
Read now
Unlock full access