Capítulo 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 también proporciona Kubernetes para uso en contenedores organizados. Para más información sobre Kubernetes, consulte Get Started Orchestrating Docker Containers with 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:
  • Contenedor – un entorno de prueba de aplicaciones. Cada contenedor se basa en una imagen que guarda los datos de configuración necesarios. Cuando usted lanza un contenedor desde una imagen, se agrega una capa de escritura en la parte superior de esta imagen. Cada vez que usted envía un contenedor (mediante el comando docker commit), se agrega una nueva capa de imagen para guardar sus cambios.
  • Imagen – una instantánea estática de la configuración de contenedores. La imagen es una capa de solo lectura que nunca se modifica, todos los cambios se hacen en la parte superior de la capa de escritura y pueden guardarse únicamente al crear una nueva imagen. Cada imagen depende de una o más imágenes padres.
  • 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 Figura 11.1, “Capas de imágenes con el formato Docker”.
  • Registro – un repositorio de imágenes. Los registros son repositorios públicos o privados que contienen imágenes disponibles para descargar. Algunos registros permiten a los usuarios cargar imágenes para que puedan estar disponibles para otros.
  • Dockerfile – un archivo de configuración con instrucciones de construcción para imágenes de Docker. Dockerfiles proporcionan una forma de automatizar, reutilizar y compartir procedimientos de construcción.
Capas de imágenes con el formato Docker

Figura 11.1. Capas de imágenes con el formato Docker