How to run Docker Commands

What is Docker? | AWS
Docker

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:

      https://docs.docker.com/engine/reference/run/

      0 Shares:
      Leave a Reply

      Your email address will not be published. Required fields are marked *

      You May Also Like