Commands

Cards (5)

  • Build an Image:
    • docker build -t <image_name>:<tag> <path_to_Dockerfile>
    Run a Container:
    • docker run -d --name <container_name> <image_name>:<tag>
    List Running Containers:
    • docker ps
    List All Containers (including stopped):
    • docker ps -a
  • Stop a Container:
    • docker stop <container_name or container_id>
    Remove a Container:
    • docker rm <container_name or container_id>
    Remove an Image:
    • docker rmi <image_name>:<tag>
  • Docker Info:
    • docker info
    Docker Version:
    • docker version
    Docker System Prune (Clean Up):
    • docker system prune -a
    Inspect Container:
    • docker inspect <container_name or container_id>
  • Inspect Image:
    • docker image inspect <image_name>:<tag>
  • Container Logs:
    • docker logs <container_name or container_id>
    Access Container Shell:
    • docker exec -it <container_name or container_id> /bin/bash
    Docker Scan (Built-in):
    • docker scan <image_name>:<tag>