Docker About

What is docker?

../../_images/docker-vs-lxc.png
../../_images/docker-arch.png
../../_images/docker-stack-01-baremetal.png
../../_images/docker-stack-02-virtualization-1.png
../../_images/docker-stack-02-virtualization-2.png
../../_images/docker-stack-02-virtualization-3.png
../../_images/docker-stack-02-virtualization-4.png
../../_images/docker-stack-03-docker.png
../../_images/docker-stack-05-kubernetes.png
../../_images/docker-stack-06-architecture.png

Architecture

Guest

Container running on Docker Engine

Host

Server running Docker Engine, see also Docker 0

Docker 0

Server running Docker Engine

Image vs Container

Image

Ready to run Operating System with pre-installed software

Container

Running instance of an image

Layers

Layer

Diff between outputs of Dockerfile RUN command while building an image

../../_images/docker-layer-images.png

Layers

../../_images/docker-layers.png

Layers

../../_images/docker-container-layers.jpg

Container Layers

../../_images/docker-container-layers.png

Container Layers

Open Container Initiative

The Open Container Initiative is an open governance structure for the express purpose of creating open industry standards around container formats and runtimes.

Established in June 2015 by Docker and other leaders in the container industry, the OCI currently contains two specifications: the Runtime Specification (runtime-spec) and the Image Specification (image-spec). The Runtime Specification outlines how to run a β€œfilesystem bundle” that is unpacked on disk. At a high-level an OCI implementation would download an OCI Image then unpack that image into an OCI Runtime filesystem bundle. At this point the OCI Runtime Bundle would be run by an OCI Runtime.

Where Docker store logs

  • Ubuntu (old using upstart) - /var/log/upstart/docker.log

  • Ubuntu (new using systemd) - sudo journalctl -fu docker.service

  • Amazon Linux AMI - /var/log/docker

  • Boot2Docker - /var/log/docker.log

  • Debian GNU/Linux - /var/log/daemon.log

  • CentOS - /var/log/message | grep docker

  • CoreOS - journalctl -u docker.service

  • Fedora - journalctl -u docker.service

  • Red Hat Enterprise Linux Server - /var/log/messages | grep docker

  • OpenSuSE - journalctl -u docker.service

  • OSX - ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/log/docker.log

  • Windows - Get-EventLog -LogName Application -Source Docker -After (Get-Date).AddMinutes(-5) | Sort-Object Time

Where Docker store containers

  • Docker rootfull /var/lib/docker/containers

  • Docker rootless ~/.local/share/docker/

Docker rootfull:

$ docker info |grep 'Docker Root Dir'
Docker Root Dir: /var/lib/docker

Docker rootless:

$ docker info |grep 'Docker Root Dir'
Docker Root Dir: /home/ubuntu/.local/share/docker