Rewrite introductory paragraph

I may have made it more complicated than before…

Might be case of deciding what to leave out (e.g. I've tried to explain distinction between images and containers and 
give a simple example where containers only do one thing –  I was thoroughly confused when first searching the Docker Hub…)
This commit is contained in:
William Turrell
2016-10-10 23:26:05 +01:00
committed by GitHub
parent 3ef02dca0d
commit f6c3087e36

View File

@@ -5,7 +5,11 @@ anchor: docker
## Docker {#docker_title}
[Docker] is so called because it's all about containers. It's a lightweight alternative to a fully-fledged Vagrant VM. PHP's OOP is perhaps a helpful analogy to understanding it: think of Docker "images" as classes and "containers" as instances of them. For a typical LAMP application, you might have a web server container, another for the PHP-FPM process and a third for the MySQL server. Your project files - PHP, HTML, other assets, database contents all remain on your host computer. You can create containers from the command line, or build a `docker-compose.yml` file that specifies which to use and how they communicate ("link") with one another.
[Docker] - a lightweight alternative to a full virtual machine - is so called because it's all about "containers". A container is a building block which, in the simplest case, does one specific job, e.g. running a web server. An "image" is the package you use to build the container - Docker has a repository full of them.
A typical LAMP application might have three containers: a web server, a PHP-FPM process and MySQL. As with shared folders in Vagrant, you can leave your application files where they are and tell Docker where to find them.
You can generate containers from the command line (see example below) or, for ease of maintenance, build a `docker-compose.yml` file for your project specifying which to create and how they communicate with one another.
Docker may help if you're developing multiple websites and want the separation that comes from installing each on it's own virtual machine, but don't have the necessary disk space or the time to keep everything up to date. It's efficient: the installation and downloads are quicker, you only need to store one copy of each image however often it's used, containers need less RAM and share the same OS kernel, so you can have more servers running simultaneously, and it takes a matter of seconds to stop and start them, no need to wait for a full server boot.