Learning Docker - Second Edition
Chapter 1, Getting Started with Docker, talks about the various distinctions of the open- source Docker platform and how it simplifies and speeds up the process of realizing containerized workloads to be readily deployed and run on a variety of operating systems, bare metal servers, and virtual machines. This chapter also has step-by-step details on installing the Docker Engine, downloading a Docker image from the centralized Docker Hub, creating a Docker container out of that image, and troubleshooting the Docker container.
Chapter 2, Handling Docker Containers, is dedicated to clearly explaining the various commands required to manage Docker images and containers. This chapter provides the basic Docker terminologies needed to understand the output of Docker commands. Other details covered here include starting an interactive session inside a container, managing your images, running containers, and tracking changes inside containers.
Chapter 3, Building Images, describes how Docker images are built. There are several ways and means through which Docker images are built and stored. The other important topics covered in this chapter include a quick overview of a Dockerfile's syntax and a bit of theoretical information on how Docker stores images.
Chapter 4, Publishing Images, tells you everything about publishing images on the centralized Docker Hub and how to get the most out of Docker Hub. The other important contents in the chapter include more details about Docker Hub, how to push images to Docker Hub, the automatic building of images, how to create organizations on Docker Hub, and finally private repositories.
Chapter 5, Running Your Private Docker Infrastructure, explains how corporates can set up and run their own private repositories. There are a few valid reasons why corporates want to have their own repositories to host some crucial Docker images. This means that publicly available repositories are found unsuitable for storing certain specific images. This chapter has all the information required to set up and sustain private repositories.
Chapter 6, Running Services in a Container, illustrates how a web application can be run inside a Docker container as a service and how to expose the service, in order for the outside world to find and access it. How the appropriate Dockerfile is developed to simplify this task is also described in detail.
Chapter 7, Sharing Data with Containers, shows you how to use Docker's volumes feature to share data between the Docker host and its containers. The other topics covered here are how to share data between containers, the common use cases, and the typical pitfalls to avoid.
[2 ]
Preface
Chapter 8, Orchestrating Containers, explains how to do the orchestration of multiple containers towards composite and containerized workloads. It is a well-known truth that orchestration plays a major role in producing composite applications. This chapter includes relevant details about the orchestration process and the toolset made available for enabling the process of orchestration. Finally, you will find a well-orchestrated example of how containers can be orchestrated to bring forth highly reusable and business-aware containers.
Chapter 9, Testing with Docker, focuses on testing your code inside Docker images. You will also find out how to run tests inside an ad hoc Docker image. Finally, you will be given details of how to integrate Docker testing into a continuous integration server such as Jenkins.
Chapter 10, Debugging Containers, teaches you how to debug applications running inside containers. How Docker ensures that processes running inside containers are isolated from the outside world is also covered.
Chapter 11, Securing Docker Containers, explains the security and privacy challenges and concerns, and how they are addressed through the liberal use of competent standards, technologies, and tools. This chapter covers the mechanism for dropping user privileges once inside an image. There is also a brief introduction to how the security capabilities introduced in SELinux come in handy when securing Docker containers.
Chapter 12, The Docker Platform – Distinct Capabilities and Use Cases, describes how the Docker platform is becoming an enterprise-grade method for bringing forth a variety of distinct automation in the fields of software engineering and distributed computing. Several industry case studies are included in this chapter in order to address any worries about Docker and to enhance its penetration and participation.
Docker从入门到实践
Docker从入门到实践,目录如下
前言
修订记录
如何贡献
Docker 简介
什么是 Docker
为什么要用 Docker
基本概念
镜像
容器
仓库
安装 Docker
Ubuntu
Debian
CentOS
Raspberry Pi
macOS
Windows PC
镜像加速器
使用镜像
获取镜像
列出镜像
删除本地镜像
利用 commit 理解镜像构成
使用 Dockerfile 定制镜像
Dockerfile 指令详解
COPY 复制文件
ADD 更高级的复制文件
CMD 容器启动命令
ENTRYPOINT 入口点
ENV 设置环境变量
ARG 构建参数
VOLUME 定义匿名卷
EXPOSE 暴露端口
WORKDIR 指定工作目录
USER 指定当前用户
HEALTHCHECK 健康检查
ONBUILD 为他人作嫁衣裳
参考文档
Dockerfile 多阶段构建
其它制作镜像的方式
实现原理
操作容器
启动
守护态运行
终止
进入容器
导出和导入
删除
访问仓库
Docker Hub
私有仓库
私有仓库高级配置
Nexus 3
数据管理
数据卷
挂载主机目录
使用网络
外部访问容器
容器互联
配置 DNS
高级网络配置
快速配置指南
容器访问控制
端口映射实现
配置 docker0 网桥
自定义网桥
工具和示例
编辑网络配置文件
实例:创建一个点到点连接
Docker 三剑客之 Compose 项目
简介
安装与卸载
使用
命令说明
Compose 模板文件
实战 Django
实战 Rails
实战 WordPress
Docker 三剑客之 Machine 项目
安装
使用
Docker 三剑客之 Docker Swarm
Swarm mode
基本概念
创建 Swarm 集群
部署服务
使用 compose 文件
管理敏感数据
管理配置信息
滚动升级
安全
内核命名空间
控制组
服务端防护
内核能力机制
其它安全特性
总结
底层实现
基本架构
命名空间
控制组
联合文件系统
容器格式
网络
Etcd 项目
简介
安装
集群
使用 etcdctl
CoreOS 项目
简介
工具
快速搭建 CoreOS 集群
Kubernetes 项目
简介
快速上手
基本概念
kubectl 使用
架构设计
Mesos - 优秀的集群资源调度平台
Mesos 简介
安装与使用
原理与架构
Mesos 配置项解析
日志与监控
常见应用框架
本章小结
容器与云计算
简介
亚马逊云
腾讯云
阿里云
小结
实战案例-操作系统
Busybox
Alpine
Debian Ubuntu
CentOS Fedora
本章小结
实战案例-CI/CD
Drone
Docker 开源项目
LinuxKit
附录
附录一:常见问题总结
附录二:热门镜像介绍
Ubuntu
CentOS
MySQL
MongoDB
Redis
Nginx
WordPress
Node.js
附录三:Docker 命令查询
附录四:Dockerfile 最佳实践
附录五:资源链接
附录六:Docker 中文资源