We will see some docker commands to run the docker image Docker command to check running containers
Firstly we will some commands on our daily usage
Docker command to check running containers
docker ps -a
Run a Docker Image
docker run -d <image:tag>
Example:
docker run -d nginx:latest
Add infinity sleep command while running the docker image
docker run -d nginx:latest sleep infinity
Here we have provided the command “sleep infinity”, this command will keep the docker container running for infinity time without exiting.
This option will be used to test anything on an image.
Reference docker documentation links: