asotog
6/24/2019 - 8:45 PM

Docker sheet

List Docker CLI commands

  • docker
  • docker container --help

Display Docker version and info

  • docker --version
  • docker version
  • docker info

Execute Docker image

  • docker run hello-world

Build and run custom image

  • docker build -f test.Dockerfile -t foo . && docker run -it foo

List Docker images

  • docker image ls

Utils

  • docker cp C:\javascript-console-repo-0.7-SNAPSHOT.amp DOCKER_CONTAINER_ID:/usr/local/tomcat/amps
  • docker container restart DOCKER_CONTAINER_ID

List Docker containers (running, all, all in quiet mode, inspect details, get inside the container)

  • docker container ls
  • docker container ls --all
  • docker container ls -aq
  • docker inspect CONTAINER_ID
  • docker exec -it CONTAINER_ID /bin/bash

Volumes

  • docker volume ls

docker compose

run all containers configured

docker-compose up --build

run specific containers configured on same yaml

docker-compose up mongo unleash keycloak