Docker Command Cheatsheet






Today , I am going to share with you all, some of the commonly used Docker commands. 

Docker Cheatsheet:
  1. $ docker version                              to know the current docker version
  2. $ docker version — format ‘{{.Server.Version}}’. to get the server version

Docker Container Lifecycle:

  1. $ docker create    creates a container but does not start it
  2. $ docker rename    allows the container to be renamed
  3. $ docker run          creates and starts a container in one operation
  4. $ docker rm            deletes a container
  5. $ docker rm -v   delete container and also remove the volumes associated with the container
Starting & Stopping a Docker container
  1. $ docker starts     starts a container so it is running
  2. $ docker stop         stops a running container
  3. $ docker pause       pauses or suspend a running container
  4. $ docker restart   stops and starts a container.
  5. $ docker wait         blocks until running container stops
  6. $ docker kill         sends a SIGKILL to a running container
  7. $ docker attach     will connect to a running container.

Other Docker commands:
  1. $ docker cp                copies files or folders between a container and the local filesystem
  2. $ docker export        turns container filesystem into tarball archive stream to STDOUT
  3. $ docker history      shows history of image
  4. $ docker tag              tags an image to a name (local or registry)
  5. $ docker ps                lists all running containers
  6. $ docker inspect      looks at all the info on a container (including IP address)

Comments

Popular posts from this blog

DevOps and Left Shift Principle, to reduce errors