====== Docker ====== ===== Release / History ===== [[https://www.docker.com/|{{ https://upload.wikimedia.org/wikipedia/commons/7/79/Docker_%28container_engine%29_logo.png}}]] * License: Apache 2.0 * Started by Solomon Hykes at dotCloud * Jeff Lindsay independent collaborator * Released as open source in March 2013 * In the years 2013 – 2016 many organizations started to support Docker * Cisco, Google, Huawei, IBM, Microsoft, and Red Hat * October 2015, the project had over 25,600 GitHub stars Source: [[https://de.wikipedia.org/wiki/Docker_(Software)]] \\ Picture Source: \\ [[https://commons.wikimedia.org/wiki/File:Docker_(container_engine)_logo.svg]] ===== Architectural Facts ===== LXC -> libcontainer * Operating System Level Virtualization (no Hypervisor) * based on Linux Containers (LXC) * March 2014, with release version 0.9 Docker dropped LXC * Development of “libcontainer” started * cross-system abstraction layer * Docker execution environment * builds up a new container specification * wraps control-groups, namespaces and UnionFS * Similar implementations * rkt, FreeBSD Jail, OpenVZ, system-nspawn {{https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Docker-linux-interfaces.svg/400px-Docker-linux-interfaces.svg.png}} Picture License: Public Domain \\ [[https://commons.wikimedia.org/wiki/File:Docker-linux-interfaces.svg#/media/File:Docker-linux-interfaces.svg]] ===== Deployment Facts ===== OS manages everything * a container is an isolation by defining limits through kernel features * Namespaces * process ids, hostnames, user ids and network access isolation * cgroups * Resource Management/-Limiting, CPU, memory, disk I/O, network * Docker introduces copy-on-write storage to manage images and containers * Docker aims to simplify and abstract this kernel level operations * a container feels like a VM but exists only due to an isolation mechanism provided by the OS {{:en:dev:env:dockercontainer1.jpg?400|}} ===== Components 1 ===== Docker as an abstraction layer * Software * Docker daemon * listens to requests sent via Docker-Engine-API (REST) * Docker client * uses Docker-Engine-API * Objects * Images * Containers * Services * Registries * Hub * Sharing Images * Public: Docker Hub, Docker Cloud * Platform independent Container Specification {{:en:dev:env:dockerlayers.jpg?400|}} ===== Components 2 ===== Docker Images and Containers * Images * built up from a series of layers * each represents an instruction in a dockerfile or may be a manual configuration * layers are read only, except the last one * Container * a read write layer * to be able to modify data which was read in an image layer, a copy-on-write process must be performed * copy-on-write copies a file from an image layer to the container layer before the system can modify it * all modifications may only be done on container layer * Flexible and Fast * it is possible to start multiple containers of the same kind quickly * versioning is easy to implement {{:en:dev:env:dockercontainerlayer.jpg?400|}} ===== Components 3 ===== Docker Volumes * Volumes * define a volume which will be available in a container as folder * managed by Docker daemon on host * enables a sharing mechanism between containers * flexible, as directly managed by Docker and thus platform independent * remotely available * may be started pre-populated in a container, to avoid copy-on-write * Bind Mounts * directly mount a host folder into a container * not managed by Docker, not platform independent * Tmpfs mounts * temporary and only in memory * useful for sensitive data * no sharing, only on linux {{:en:dev:env:dockervolumes.jpg?400|}} ===== Components 4 ===== Registry and Services * Registries enable sharing of images * push images to a registry to start sharing * pull images, to start from * thousands of apps available, each in an single image * different application versions, pre-configured in images * Public Registries * Docker Hub, Docker Cloud * Services * Scale containers across Docker daemons, swarm ===== Tools ===== Used to interact with Docker daemon * Docker-Toolbox * works on Windows and Mac * needs a virtualization driver to load a boot2docker iso * Virtualbox * Hyper-V * provides Docker-machine command to remotely interact with the Docker host, which is running in a VM * DockerCLI * provides commands to interact with the daemon, interacts mostly over Docker-Engine-API * Docker-Compose * runs multi-container Docker applications * configure a landscape using a YAML file * define ports, networks, volumes, environment variables, start order, dependencies * Kubernetes * Container Orchestration * automated deployment, scaling, and management Sources: [[https://docs.docker.com/engine/docker-overview/]] \\ [[https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-socket-option]] \\ [[https://docs.docker.com/storage/storagedriver/#images-and-layers]] \\ [[https://docs.docker.com/compose/overview/]] \\ [[https://docs.docker.com/machine/]] \\ [[https://en.wikipedia.org/wiki/Docker_(software)]] \\ [[http://jancorg.github.io/blog/2015/01/03/libcontainer-overview/]] \\ [[https://github.com/docker/libcontainer/blob/4940cee052ece5a8b2ea477699e7bb232de1e1f8/SPEC.md]] \\ [[https://www.infoq.com/news/2013/03/Docker]] \\ [[https://github.com/torvalds/linux]] \\