Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Sébastien Goasguen

Rating No ratings yet

Whether you’re deploying applications on-premise or in the cloud, this cookbook is for developers, operators, and IT professionals who need practical solutions for using Docker. The recipes in this book will help developers go from zero knowledge to distributed applications packaged and deployed within a couple of chapters. IT professionals will be able to use this cookbook to solve everyday problems, as well as create, run, share, and deploy Docker images quickly. Operators will learn and understand what developers are excited about and start to adopt the tools that will change the way they work. Get started using Docker immediately Learn how to use Docker for large-scale deployments Become familiar with other tools in the Docker ecosystem, such as kubernetes and coreos Use Docker in production, with recipes on cloud administration, monitoring, and common related components Docker’s new approach to containerization and its enhancements in terms of security, integration with existing development tools, and application sharing are revolutionizing the way developers think about creating new applications and the way system administrators might operate their infrastructure in the future.

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A practical, recipe-driven guide for developers, operators, and IT professionals who want to move from Docker basics to building, sharing, and orchestrating containerized applications—including hands-on coverage of Kubernetes, Swarm, and other ecosystem tools. 【Book Arc】 - **Opening (~0%–9%)**: Sets expectations for an intermediate audience, listing prerequisites (Bash, package management, Git, Python, Vagrant) and outlining the cookbook structure—from first steps to production deployment. - **Early (~9%–25%)**: Covers Docker fundamentals: running your first container (`hello world`), managing images and containers, using data containers for volume sharing, and linking containers (e.g., WordPress + MySQL). Introduces the idea of single-purpose containers. - **Early (~25%–34%)**: Moves to image creation and sharing: writing your first Dockerfile (FROM, ENTRYPOINT), tagging images for versioning, and using Packer to build images from existing provisioning workflows (shell, Ansible, Chef). - **Middle (~34%–47%)**: Explores networking options in depth: default bridge, `--net=none`, `--net=host` (with warnings about security), and sharing another container's network stack. Emphasizes isolation and the risks of privileged containers. - **Middle (~47%–end)**: Expands into the Docker ecosystem: Docker Compose for multi-container apps (WordPress, Mesos/Marathon), Swarm for clustering, Docker Machine for cloud provisioning, and orchestration tools like Kubernetes, Rancher, and Mesos—plus service discovery with Registrator. 【Key Takeaways】 - **Start with the lifecycle of a container** (Early): Learn `docker run`, `docker ps -a`, `docker rm`, and `docker rmi` to understand that containers exit after their task, but images persist locally. This foundation prevents confusion later. - **Use data containers for shared, persistent volumes** (Early): By omitting the host path in `-v`, Docker manages the volume; use `--volumes-from` to share it across containers. This keeps storage decoupled from any single container's lifecycle. - **Link containers for simple service discovery** (Early): The `--link` flag lets a WordPress container talk to a MySQL container without exposing ports publicly—a quick way to build multi-container apps before moving to orchestration. - **Automate image builds with Dockerfiles** (Early): A Dockerfile (FROM, ENTRYPOINT, CMD, EXPOSE) turns manual container commits into repeatable, shareable build steps. This is the core of reproducible infrastructure. - **Tag images for versioning and sharing** (Early): Use `docker tag` to assign meaningful repository names (e.g., `how2dock/flask`) before pushing to Docker Hub; layers already present are skipped, making pushes efficient. - **Choose networking stacks deliberately** (Middle): `--net=none` gives isolation, `--net=host` shares the host's interfaces (dangerous with `--privileged`), and sharing another container's stack enables specific topologies. Understand the trade-offs before choosing. - **Orchestration is the next step after single-host Docker** (Middle): Tools like Compose, Swarm, and Kubernetes solve multi-container, multi-host problems—but they build on the same image and container primitives you've already mastered. 【Reading Tips】 - **Skim the first chapters if you're not a beginner**: The early recipes (hello world, data containers, linking) are foundational but simple; focus on the Dockerfile and networking sections for deeper insights. - **Deep-read the networking chapter (Chapter 3)**: It's the most technical and security-sensitive part—pay attention to the warnings about `--net=host` and privileged containers. - **Use the ecosystem chapter as a reference, not a tutorial**: Recipes for Compose, Swarm, Kubernetes, and Mesos are broad; pick one tool that matches your deployment target and follow that recipe end-to-end. - **Try the Packer recipe if you're migrating from VMs**: It bridges traditional provisioning (Ansible, Chef) with Docker, which is valuable for teams with existing DevOps workflows. - **Keep a terminal handy**: The book is full of command-line examples; running them as you read will cement the concepts faster than reading alone. 【Coverage Limits】 This guide synthesizes the provided excerpts, which cover roughly the first half of the book (fundamentals, image creation, networking) and a table of contents for the ecosystem chapters. Detailed recipes for Kubernetes, Swarm, and production monitoring are not fully covered in the source material.
Page 6
ode Kubernetes Cluster Using Docker Compose 143 5.12 Compiling Kubernetes to Create Your Own Release 146 5.13 Starting Kubernetes Components with hyperkube B...
View in text
Excerpt 2
volume specified is created inside the container as a read- write filesystem not layered on top of the read-only layers used to create the container image. D...
View in text
Excerpt 3
ation and Sharing 2.5 Versioning an Image with Tags Problem You are creating multiple images and multiple versions of the same image. You would like to keep...
View in text
Excerpt 4
ncluding the docker0 bridge. This means that while the con‐ tainer processes are isolated in their own namespace and resource limited through cgroup, the net...
View in text
Excerpt 5
ff:ff:ff:ff:ff:ff inet 172.21.0.5/16 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::42:b3ff:fe91:22c3/64 scope link valid_lft forever...
View in text
Excerpt 6
d Template and a count for the number of desired replicas 2. The Kubernetes uses the template in the Replication Controller to create a num‐ ber of actual po...
View in text
Excerpt 7
of a Kubernetes cluster. This is what was used in Recipe 5.11 to run Kubernetes in a single node using Docker containers. You can use this Dockerfile to buil...
View in text
Excerpt 8
d7e7225d7d7 If you curl this URL (curl -s https://discovery.etcd.io/ 61297b379e5024f33b57bd7e7225d7d7 | python -m json.tool), you will see the IPs of the nod...
View in text
Tags
AI categories
Cloud NativeDevOpsBackend
ISBN: 149191971X
Publisher: O'Reilly Media
Publish Year: 2015
Language: English
Pages: 400
File Format: PDF
File Size: 5.9 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…