→Running in container
== What is Docker? ==
Docker is a platform built around linux containers to provide the possibility to build, ship and run distributed applications in containers. It allows users to quickly deploy their applications atop of linux system of their choice in a safe environment. For more information see [https://docs.docker.com/introduction/understanding-docker/ understanding docker].
== Prerequisites ==
Docker makes use of many kernel features to function properly. As
a prerequisites, make sure your kernel has all of them enabled.
To check this you may use the script provided with docker package as follows.
== Installation ==
Calculating dependencies... done!
[ebuild N ] dev-lang/go-1.3.1 USE="-emacs -vim-syntax -zsh-completion"
[ebuild N ] app-emulation/docker-1.1.0 USE="contrib device-mapper -aufs -btrfs -doc -lxc -vim-syntax -zsh-completion"
If everything went well and no errors appeared during the installation, you're almost ready to go. The only thing that is left is to run the docker daemon.
== Playing with Docker ==
=== Getting images ===
The first thing you need is a base image. Base image is a minimal container with an os. You can browse available images on [https://registry.hub.docker.com/ docker hub] or through the commandline.
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
busybox Busybox base image. 60 [OK]
... snip ...
flynn/busybox Busybox from Ubuntu 13.10 with libc 0
Let's get the official busybox image.
Pulling repository busybox
37fca75d01ff: Download complete
c120b7cab0b0: Download complete
f06b02872d52: Download complete
=== Running in container ===
With the image on your drive, you can give it a spin.
-i means the container should be interactive}}
You are now presented a shell running in the container. You can try looking around. We will now create a new file in the container and leave it.
=== Listing containers ===
When the process running in the container ends, the container is stopped. If we were to execute the <code>docker run</code> command again, our message file wouldn't be there, because <code>docker run</code> creates a new container from the base image and runs it. To resume our container, we have to find it's name.