Intro Docker Commands

Quick way to get started with Docker post install

Installing docker is easy and well documented at Docker Docs. Here are some quick commands you can use to get started with Docker containers.

  • Docker version:

    docker --version
  • List all images that are locally stored:

    docker image ls
  • Pull an image from a registry:

    docker pull myimage:1.0
  • Delete an image from the local image store:

    docker image rm alpine:3.4
  • Start a Docker container with latest alpine image

    docker container run --name <Name of container> alpine:latest
  • List Docker containers (running and stopped):
    docker container ls --all
  • Access Docker container with bash shell:
    docker exec -it <Name of container> /bin/bash
  • Run a quick command (file system sizing) in container without accessing container:
    docker exec -it <Name of container> df -hP

No Comments Yet