Update docker documentation authored by Harri Jäntti's avatar Harri Jäntti
...@@ -37,12 +37,17 @@ EXPOSE 8080 25 20 9888 9889 9997 9999 22 2181 9090 9094 9093 9998 ...@@ -37,12 +37,17 @@ EXPOSE 8080 25 20 9888 9889 9997 9999 22 2181 9090 9094 9093 9998
</code> </code>
</pre> </pre>
## Container ## Container
Container is an image that is running, usually a single process A container is an image that is currently running, which usually is a single process. Containers are used to package a piece of software, making it lightweight, stand-alone and executable regardless of the environment. Containers include everything that the program needs to run, like code, runtime, system tools, system libraries, settings. Placing a program into a container isolates it from its surroundings and thus allows it to mitigate differences between different environments, reducing conflicts that might arise between teams running different software on the same infrastructure.
[Piirrä kuva](https://www.docker.com/what-container)
The major difference between a container and an image is the top writable layer. All writes to the container that add new or modify existing data are stored in this writable layer. When the container is deleted, the writable layer is also deleted. The underlying image remains unchanged.
Because each container has its own writable container layer, and all changes are stored in this container layer, multiple containers can share access to the same underlying image and yet have their own data state. The diagram below shows multiple containers sharing the same Ubuntu 15.04 image.
## Docker basic commands ### Docker basic commands
<pre> <pre>
<code> <code>
...@@ -50,6 +55,6 @@ docker run <image> ...@@ -50,6 +55,6 @@ docker run <image>
docker start <name|id> docker start <name|id>
docker stop <name|id> docker stop <name|id>
docker ps [-a include stopped containers] docker ps [-a include stopped containers]
docker rm <name|id> docker rm <name|id> [rmi image delete, rm container delete]
</code> </code>
</pre> </pre>
\ No newline at end of file