Show Notes #349: Docker Deep Dive

Listen Now

Segment 1 (Deep Dive)

  • Docker
  • Components
    • Docker Engine
    • Docker Build
    • Docker Compose
    • Docker Desktop (Mac/Windows)
  • Concepts
    • Shares resources from the OS kernel.
    • Not meant to run a virtual machine but to perform a single task or computation. The container only lasts as long as the process/computation within it is active.
  • Installation
    • Do not use "sudo apt install docker" in your package manager.
    • https://lhs.fyi/ma (Ubuntu installation procedure)
    • Allow unprivileged users to run Docker
      • sudo usermod -a -G docker $USER
  • Useful Commands
    • docker run (spin up a Docker container)
      • -d (detached)
      • -i (interactive / map stdin to container)
      • -t (invoke psuedo terminal on run)
      • -p (map external port to container port)
      • -v (map external filesystem to container filesystem)
      • -e (assign env variable to container)
      • --network (specify container network options)
    • docker ps [-a] (see running [and ended] Docker containers)
    • docker rm (remove a container)
    • docker images (see installed images)
    • docker rmi (remove image)
    • docker pull (download an image)
    • docker exec (run a command inside a container)
    • docker attach (foreground detached container)
    • docker inspect (details dumped as JSON)
    • docker network ls (show container networks)
  • Docker Storage
    • /var/lib/docker/(aufs,containers,image,volumes)
    • docker volume create <data_volume>
    • -v data_volume:<volume>
    • -v <full path>:<volume> (bind mount existing data)
    • --mount type=<>,source=<src>,target=<>

Segment 2 (Announcements & Feedback)

  • E-mail from Ian, NV4C