Docker Goodies – Frequent Commands

Noting some of the usual Docker commands I run for future reference…

  • Start Docker daemon = systemctl start docker
  • View running Docker images = docker ps
  • View all images on the server = docker images or docker image ls
  • Remove all images on the server (dangling and unused) = docker images prune -a
  • Build my image = docker build -f <dockerfile_path> .
  • Run my Docker image and check Ansible version = docker run –rm -it <image_id> –version
  • Tag new image = docker tag <image> devopsunleashed/ansible:3.31.1
  • Login to Docker Hub = docker login -u <user> -p <pw>
  • Push image to Docker Hub = docker push devopsunleashed/ansible:3.31.1

Awesome Docker command cheat-sheet (link)