Red Hat Training

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

Capitolo 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.
Kubernetes è disponibile tramite Red Hat e può essere utilizzato con i container. Per maggiori informazioni su Kubernetes consultare Introduzione al Controllo dei container Docker con 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 - un sandbox delle applicazioni. Ogni container si basa su una immagine che contiene i dati necessari per la configurazione. Al momento di lanciare un container da una immagine, un livello modificabile viene aggiunto sopra l'immagine. Ogni qualvolta che si esegue il commit di un container (tramite il comando docker commit), verrà aggiunto un nuovo livello per l'archiviazione delle modifiche.
  • Image – una istantanea statica della configurazione del container. L'immagine è un livello "in sola lettura" che non potrà mai essere modificato, tutte le modifiche verranno eseguite nel livello più alto modificabile, e verranno archiviate solo tramite la creazione di una nuova immagine. Ogni immagine dipende da una o più immagini genitore.
  • 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, «Livelli immagine con formato Docker».
  • Registro – un repository di immagini. I registri sono repository pubblici o privati che contengono immagini disponibili per il download. Alcuni registri permettono agli utenti di caricare le immagini e renderle disponibili ad altri.
  • Dockerfile – un file di configurazione con informazioni sulla compilazione per le immagini Docker. Dockerfiles forniscono un modo per automatizzare, riutilizzare e condividere le procedure di compilazione.
Livelli immagine con formato Docker

Figura 11.1. Livelli immagine con formato Docker