The Docker Book: Containerization is the new virtualization
Format: PDF / Kindle (mobi) / ePub
Updated for Docker 1.10.3!
A new book designed for SysAdmins, Operations staff, Developers and DevOps who are interested in deploying the open source container service Docker.
In this book, we'll will walk you through installing, deploying, managing, and extending Docker. We're going to do that by first introducing you to the basics of Docker and its components. Then we'll start to use Docker to build containers and services to perform a variety of tasks.
We're going to take you through the development life cycle, from testing to production, and see where Docker fits in and how it can make your life easier. We'll make use of Docker to build test environments for new projects, demonstrate how to integrate Docker with continuous integration workflow, and then how to build application services and platforms. Finally, we'll show you how to use Docker's API and how to extend Docker yourself.
We'll teach you how to:
* Install Docker.
* Take your first steps with a Docker container.
* Build Docker images.
* Manage and share Docker images.
* Run and manage more complex Docker containers.
* Deploy Docker containers as part of your testing pipeline.
* Build multi-container applications and environments.
* Learn about orchestration. Use Compose and Swarm for the orchestration of Docker containers and Consul for service discovery.
* Explore the Docker API.
* Getting Help and Extending Docker.
Updated for Docker 1.10.3!
The various startup configurations. On Ubuntu, this is done by editing the /etc/default/docker file and changing the DOCKER_OPTS variable. On Fedora and Red Hat distributions, this can be configured by editing the /etc/systemd/system/docker.service file and adjusting the ExecStart line. Note On other platforms, you can manage and update the Docker daemon's starting configuration via the appropriate init mechanism. Checking that the Docker daemon is running On Ubuntu, if Docker has been.
Filesystem, bootfs, which resembles the typical Linux/Unix boot filesystem. A Docker user will probably never interact with the boot filesystem. Indeed, when a container has booted, it is moved into memory, and the boot filesystem is unmounted to free up the RAM used by the initrd disk image. So far this looks pretty much like a typical Linux virtualization stack. Indeed, Docker next layers a root filesystem, rootfs, on top of the boot filesystem. This rootfs can be one or more operating systems.
In Steps 1 to 3, then Docker would use the previously built images as a cache and a starting point. Essentially, it'd start the build process straight from Step 4. This can save you a lot of time when building images if a previous step has not changed. If, however, you did change something in Steps 1 to 3, then Docker would restart from the first changed instruction. Sometimes, though, you want to make sure you don't use the cache. For example, if you'd cached Step 3 above, apt-get update, then.
Populate our docker-compose.yml file. The docker-compose.yml file is a YAML file that contains instructions for running one or more Docker containers. Let's look the instructions for our example application. web: image: jamtur01/composeapp command: python app.py ports: - "5000:5000" volumes: - .:/composeapp links: - redis redis: image: redis Each service we wish to launch is specified as a YAML hash here: web and redis. For our web service we've specified some runtime options. Firstly, we've.
--tlskey=/etc/docker/server-key.pem Note You can see that we've used port number 2376; this is the default TLS/SSL port for Docker. You should only use 2375 for unauthenticated connections. This code will enable TLS using the --tlsverify flag. We've also specified the location of our CA certificate, certificate, and key using the --tlscacert, --tlscert and --tlskey flags, respectively. There are a variety of other TLS options that we could also use. Tip You can use the --tls flag to enable.