Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

All running containers start from some base image. You can find lots of open source images at Docker Hub including basic OSes (ubuntu, centos), popular database engines (postgres, mysql) and others. 

  • To download an image from Docker Hub, use: docker pull <image-name>
  • To list available images, use: docker images
  • To remove image, use: docker rmi <image-name>

Containers

  • To run a container with its default command, use: docker run <image-name>
  • To list containers, use: docker ps
  • To copy a file from/into a running container, use: docker cp <file-1> <file-2>
  • To execute a command in a running container, use: docker exec <container-id> <command>
  • To remove container, use: docker rm <container-id>
Info
titleFlags

Each command supports additional flags passed along the main arguments. Please make sure to check docker help <command> for more information.

The most often used flags are:

  • --name for docker run to specify friendly name for the container
  • -i, --interactive and -t, --tty for docker run and docker exec when you want to work in an interactive shell inside of the container

IMAS image