Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

Kapitel 11. Linux Containers

The Docker project is an open-source project that automates the deployment of applications inside Linux Containers, and provides the capability to package an application with its runtime dependencies into a container. It provides a command-line tool for the life cycle management of image-based containers. Linux containers enable rapid application deployment, simpler testing, maintenance, and troubleshooting while improving security. Using Red Hat Enterprise Linux 7 with containers allows customers to increase staff efficiency, deploy third-party applications faster, enable a more agile development environment, and manage resources more tightly.
To quickly get up-and-running with docker formatted containers, refer to Get Started with docker Formatted Containers.
Red Hat Enterprise Linux 7.1 ships with docker version 1.4.1, which includes a number of new features, security fixes, patches and changes. Highlights include:
  • The ENV instruction in the Dockerfile now supports arguments in the form of ENV name=value name2=value2 ...
  • An experimental overlayfs storage driver has been introduced.
  • An update is included for CVE-2014-9356: Path traversal during processing of absolute symlinks. Absolute symlinks were not adequately checked for traversal which created a vulnerability via image extraction and/or volume mounts.
  • An update is included for CVE-2014-9357: Escalation of privileges during decompression of LZMA (.xz) archives. Docker 1.3.2 added chroot for archive extraction. This created a vulnerability that could allow malicious images or builds to write files to the host system and escape containerization, leading to privilege escalation.
  • An update is included for CVE-2014-9358: Path traversal and spoofing opportunities via image identifiers. Image IDs passed either via docker load or registry communications were not sufficiently validated. This created a vulnerability to path traversal attacks wherein malicious images or repository spoofing could lead to graph corruption and manipulation.
Red Hat provides platform container images for building applications on both Red Hat Enterprise Linux 6 and Red Hat Enterprise Linux 7.
Red Hat stellt zudem Kubernetes bereit zur Verwaltung von Container-Gruppen. Siehe Get Started Orchestrating Docker Containers with Kubernetes für weitere Informationen über Kubernetes.
Linux containers are supported running on hosts with SELinux enabled. SELinux is not supported when the /var/lib/docker directory is located on a volume using the B-tree file system (Btrfs).

11.1. Components of docker Formatted Containers

The docker container format works with the following fundamental components:
  • Container – eine Applikations-Sandbox. Jeder Container basiert auf einem Image, das die notwendigen Konfigurationsdaten enthält. Wenn Sie einen Container von einem Image starten, wird eine schreibbare Schicht über diesem Image hinzugefügt. Jedes Mal, wenn Sie einen Container festschreiben (mithilfe des Befehls docker commit), wird eine neue Image-Schicht hinzugefügt, um Ihre Änderungen zu speichern.
  • Image – eine statische Momentaufnahme der Container-Konfiguration. Ein Image ist eine schreibgeschützte Ebene, die niemals verändert wird. Alle Änderungen werden in der obersten, schreibbaren Ebene vorgenommen und können nur als neues Image gespeichert werden. Jedes Image hängt von einem oder mehreren darunterliegenden Images ab.
  • Platform Container Image – an image that has no parent. Platform container images define the runtime environment, packages, and utilities necessary for a containerized application to run. The platform image is read-only, so any changes are reflected in the copied images stacked on top of it. See an example of such stacking in Abbildung 11.1, »Image-Schichten im Docker-Format«.
  • Registry – ein Repository mit Images. Registrys sind öffentliche oder private Repositorys, die Images zum Download bereithalten. Einige Registrys erlauben Benutzern auch das Hochladen von Images, um diese anderen Benutzern zur Verfügung zu stellen.
  • Dockerfile – eine Konfigurationsdatei mit Anweisungen zur Erstellung von Docker-Images. Dockerfiles bieten einen Weg zum Automatisieren, Wiederverwenden und Teilen von Erstellungsverfahren.
Image-Schichten im Docker-Format

Abbildung 11.1. Image-Schichten im Docker-Format