Docker

Docker is a container virtualization environment which can establish development or runtime environments without modifying the environment of the base operating system. It has the ability to deploy instances of containers that provide a thin virtualization, using the host kernel, which makes it faster and lighter than full hardware visualization.

Kernel
Kernel version 3.10 can greater is required in order to run Docker.

If the kernel has not been configured properly before installing as list of missing kernel options will be provided. These kernel features must be enabled manually. (forward slash) can be used while in the ncurses-based menuconfig to search the name of the configuration option.

After exiting the kernel configuration, rebuild the kernel. If the kernel rebuild as also a kernel upgrade be sure to rebuild the bootloader's menu configuration, then reboot the system to the newly recompiled kernel binary.

Emerge
Install :

OpenRC
After Docker has been successfully installed, start it and add it to the system's default runlevel:

Permissions
Add relevant users to the docker group:

Testing
In order to test the installation, run the following command:

That will first download from the Docker Hub the image named hello-world (if it has not been downloaded locally yet), then it will run it inside new namespaces. It purpose is just to display some text through a container.

Building from a Dockerfile
Create a new Dockerfile in an empty directory with the following content:

Run: