Merge branch 'master' of github.com:yeasy/docker_practice

pull/402/head
Baohua Yang 2019-05-05 19:31:08 +08:00
commit f7dcffc7be
75 changed files with 1121 additions and 369 deletions

View File

@ -1,4 +1,4 @@
# EditorConfig is awesome: http://EditorConfig.org
# EditorConfig is awesome: https://EditorConfig.org
root = true

2
.gitattributes vendored
View File

@ -2,4 +2,4 @@
*.sh text eol=lf
*.py linguist-language=go
* linguist-language=go

View File

@ -12,11 +12,9 @@ about: Create a report to help us improve
* [x] Linux
* [x] CentOS 7
* [x] Ubuntu 14.04
* [x] Fedora
* [x] Ubuntu 16.04 +
* [x] Debian 7
* [x] Debian 8 +
* [x] CoreOS
* [x] Debian 9 +
* [x] macOS
* [x] Windows 10
* [x] Raspberry Pi (ARM)

View File

@ -12,11 +12,9 @@ about: Create a issue about Docker
* [x] Linux
* [x] CentOS 7
* [x] Ubuntu 14.04
* [x] Fedora
* [x] Ubuntu 16.04 +
* [x] Debian 7
* [x] Debian 8 +
* [x] CoreOS
* [x] Debian 9 +
* [x] macOS
* [x] Windows 10
* [x] Raspberry Pi (ARM)

View File

@ -1,20 +1,20 @@
<!--
Thanks for your contribution.
Thanks for your contribution.
See [CONTRIBUTING](CONTRIBUTING.md) for contribution guidelines.
-->
### Proposed changes (Mandatory)
<!--
Tell us what you did and why:
Tell us what you did and why:
One line short description
And details in other paragraphs.
-->
### Fix issues (Optional)
<!--
Tell us what issues you fixed, e.g., fix #123
Tell us what issues you fixed, e.g., fix #123
-->

View File

@ -1,7 +1,8 @@
language: bash
sudo: required
services:
- docker
before_install:
- openssl aes-256-cbc -K $encrypted_6cc8cff04075_key -iv $encrypted_6cc8cff04075_iv
-in .travis/id_rsa.enc -out ~/.ssh/id_rsa -d
@ -10,8 +11,10 @@ before_install:
- date
- git config --global user.name "khs1994"
- git config --global user.email "khs1994@khs1994.com"
script:
- docker run -it --rm -v $PWD:/srv/gitbook-src yeasy/docker_practice build
after_success:
- sudo chmod -R 777 _book
- echo "FROM nginx:1.13.8-alpine" >> Dockerfile
@ -29,14 +32,17 @@ after_success:
- COMMIT=`date "+%F %T"`
- git commit -m "Travis CI Site updated $COMMIT"
- git push -f origin master:"$DEPLOY_BRANCH"
env:
global:
- DEPLOY_BRANCH: pages
# - DEPLOY_BRANCH: legacy-pages
- REPO: git@github.com:yeasy/docker_practice.git
addons:
ssh_known_hosts:
- github.com
branches:
only:
- master

View File

@ -1,8 +1,13 @@
##
* 1.1.0 2019-06-30
* `BuildKit`
* `docker manifest` 使
* `Ubuntu 14.04` `Debian 8` `Debian 7`
* 1.0.0: 2018-12-31
* v18.x
* Docker
* Docker
*
* 0.9.0: 2017-12-31

View File

@ -1,12 +1,10 @@
# Docker
[![](https://img.shields.io/github/stars/yeasy/docker_practice.svg?style=social&label=Stars)](https://github.com/yeasy/docker_practice) ![](https://img.shields.io/docker/pulls/yeasy/docker_practice.svg) [![](https://travis-ci.org/yeasy/docker_practice.svg?branch=master)](https://travis-ci.org/yeasy/docker_practice) [![](https://img.shields.io/github/release/yeasy/docker_practice/all.svg)](https://github.com/yeasy/docker_practice/releases) [![](https://badges.gitter.im/docker_practice/Lobby.svg)](https://gitter.im/docker_practice/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![](https://img.shields.io/github/stars/yeasy/docker_practice.svg?style=social&label=Stars)](https://github.com/yeasy/docker_practice) [![](https://travis-ci.org/yeasy/docker_practice.svg?branch=master)](https://travis-ci.org/yeasy/docker_practice) [![](https://img.shields.io/github/release/yeasy/docker_practice/all.svg)](https://github.com/yeasy/docker_practice/releases) [![](https://img.shields.io/badge/Based-Docker%20CE%20v18.x-blue.svg)](https://github.com/docker/docker-ce) [![](https://img.shields.io/badge/Docker%20%E6%8A%80%E6%9C%AF%E5%85%A5%E9%97%A8%E4%B8%8E%E5%AE%9E%E6%88%98-jd.com-red.svg)](https://u.jd.com/tKZmVG)
v1.0.0
**v1.1.0**
* 0.9.0 Docker CE v18.X Docker 1.13-使 [docker-legacy](https://github.com/yeasy/docker_practice/tree/docker-legacy) 分支。*
[Docker](http://www.docker.com) 是个划时代的开源项目,它彻底释放了计算虚拟化的威力,极大提高了应用的维护效率,降低了云计算应用开发的成本!使用 Docker可以让应用的部署、测试和分发都变得前所未有的高效和轻松
[Docker](https://www.docker.com) 是个划时代的开源项目,它彻底释放了计算虚拟化的威力,极大提高了应用的维护效率,降低了云计算应用开发的成本!使用 Docker可以让应用的部署、测试和分发都变得前所未有的高效和轻松
Docker
@ -30,6 +28,7 @@ Docker 自身仍在快速发展中,生态环境也在蓬勃成长。建议初
<p align="center"><strong> ~</strong></p>
##
Docker QQ Docker Docker
* QQ I 341410255
@ -41,16 +40,17 @@ Docker 自身仍在快速发展中,生态环境也在蓬勃成长。建议初
* QQ VII 252403484
* QQ VIII544818750
* QQ IX 571502246
* QQ X   145983035
* QQ X 145983035
> [Issues](https://github.com/yeasy/docker_practice/issues/new/choose) 来提出。
##
![](_images/docker_primer3.png)
[Docker ](http://item.jd.com/12453318.html)》第三版已经面世,介绍最新的容器技术栈,欢迎大家阅读使用并反馈建议。
[![](https://github.com/yeasy/docker_practice/raw/master/_images/docker_primer3.png)](https://u.jd.com/tKZmVG)
* [](https://item.jd.com/12453318.html)
[Docker ](https://u.jd.com/tKZmVG)》第三版已经面世,介绍最新的容器技术栈,欢迎大家阅读使用并反馈建议。
* [](https://u.jd.com/tKZmVG)
* [China-Pub](http://product.china-pub.com/8052127)
##

View File

@ -39,7 +39,10 @@
* [HEALTHCHECK ](image/dockerfile/healthcheck.md)
* [ONBUILD ](image/dockerfile/onbuild.md)
* [](image/dockerfile/references.md)
* [Dockerfile ](image/multistage-builds.md)
* [Dockerfile ](image/multistage-builds/README.md)
* [ Laravel ](image/multistage-builds/laravel.md)
* [ Docker ](image/manifest.md)
* [使 BuildKit ](image/buildkit.md)
* [](image/other.md)
* [](image/internal.md)
* [](container/README.md)
@ -142,6 +145,7 @@
* [](cases/os/summary.md)
* [-CI/CD](cases/ci/README.md)
* [Drone](cases/ci/drone.md)
* [Travis CI](cases/ci/travis.md)
* [Docker ](opensource/README.md)
* [LinuxKit](opensource/linuxkit.md)
* [](appendix/README.md)
@ -149,11 +153,12 @@
* [](appendix/repo/README.md)
* [Ubuntu](appendix/repo/ubuntu.md)
* [CentOS](appendix/repo/centos.md)
* [Nginx](appendix/repo/nginx.md)
* [PHP](appendix/repo/php.md)
* [MySQL](appendix/repo/mysql.md)
* [WordPress](appendix/repo/wordpress.md)
* [MongoDB](appendix/repo/mongodb.md)
* [Redis](appendix/repo/redis.md)
* [Nginx](appendix/repo/nginx.md)
* [WordPress](appendix/repo/wordpress.md)
* [Node.js](appendix/repo/nodejs.md)
* [Docker ](appendix/command/README.md)
* [Dockerfile ](appendix/best_practices.md)

View File

@ -6,7 +6,7 @@
Docker `docker0` Linux bridge
Docker [RFC1918](http://tools.ietf.org/html/rfc1918) 中定义)中的一个地址给 `docker0` 接口。比如典型的 `172.17.42.1`,掩码为 `255.255.0.0`。此后启动的容器内的网口也会自动分配一个同一网段(`172.17.0.0/16`)的地址。
Docker [RFC1918](https://tools.ietf.org/html/rfc1918) 中定义)中的一个地址给 `docker0` 接口。比如典型的 `172.17.42.1`,掩码为 `255.255.0.0`。此后启动的容器内的网口也会自动分配一个同一网段(`172.17.0.0/16`)的地址。
Docker `veth pair` `eth0` `docker0` `veth` `vethAQI2QT`Docker

View File

@ -22,7 +22,7 @@ $sysctl -w net.ipv4.ip_forward=1
#### 访
Docker dockerd iptables FORWARD `ACCEPT``DROP``--icc=true` `--icc=false` `--iptables=false` `iptables`
`/etc/docker/daemon.json` `{"icc": false}` Ubuntu 14.04 使 upstart `/etc/default/docker` `DOCKER_OPTS=--icc=false`
`/etc/docker/daemon.json` `{"icc": false}`
#### 访
`-icc=false` 访 `--link=CONTAINER_NAME:ALIAS` 访

View File

@ -1,6 +1,6 @@
# Dockerfile
Docker [Best practices for writing Dockerfiles](https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/) 的理解与翻译。
Docker [Best practices for writing Dockerfiles](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/) 的理解与翻译。
##
@ -36,7 +36,7 @@
`buildpack-deps`
```docker
```dockerfile
RUN apt-get update && apt-get install -y \
bzr \
cvs \
@ -72,7 +72,7 @@ RUN apt-get update && apt-get install -y \
>使使
```docker
```dockerfile
# Set one or more individual labels
LABEL com.example.version="0.0.1-beta"
@ -85,7 +85,7 @@ LABEL com.example.version.is-production=""
`LABEL`
```docker
```dockerfile
# Set multiple labels at once, using line-continuation characters to break long lines
LABEL vendor=ACME\ Incorporated \
com.example.is-beta= \
@ -94,7 +94,7 @@ LABEL vendor=ACME\ Incorporated \
com.example.release-date="2015-02-12"
```
[Understanding object labels](https://docs.docker.com/engine/userguide/labels-custom-metadata/)。关于查询标签信息,参考 [Managing labels on objects](https://docs.docker.com/engine/userguide/labels-custom-metadata/#managing-labels-on-objects)。
[Understanding object labels](https://docs.docker.com/config/labels-custom-metadata/)。关于查询标签信息,参考 [Managing labels on objects](https://docs.docker.com/config/labels-custom-metadata/)。
### RUN
@ -108,7 +108,7 @@ LABEL vendor=ACME\ Incorporated \
`RUN apt-get update` `apt-get install` `RUN`
```docker
```dockerfile
RUN apt-get update && apt-get install -y \
package-bar \
package-baz \
@ -117,7 +117,7 @@ RUN apt-get update && apt-get install -y \
`apt-get update` `RUN` `apt-get install` `Dockerfile`
```docker
```dockerfile
FROM ubuntu:18.04
RUN apt-get update
@ -127,7 +127,7 @@ RUN apt-get install -y curl
Docker `apt-get install`
```docker
```dockerfile
FROM ubuntu:18.04
RUN apt-get update
@ -139,7 +139,7 @@ Docker 发现修改后的 `RUN apt-get update` 指令和之前的完全一样。
使 `RUN apt-get update && apt-get install -y` Dockerfiles `cache busting` `cache-busting`
```docker
```dockerfile
RUN apt-get update && apt-get install -y \
package-bar \
package-baz \
@ -150,7 +150,7 @@ RUN apt-get update && apt-get install -y \
`RUN` `apt-get`
```docker
```dockerfile
RUN apt-get update && apt-get install -y \
aufs-tools \
automake \
@ -193,7 +193,7 @@ RUN apt-get update && apt-get install -y \
`ENV`
```docker
```dockerfile
ENV PG_MAJOR 9.3
ENV PG_VERSION 9.3.4
@ -211,7 +211,7 @@ ENV PATH /usr/local/postgres-$PG_MAJOR/bin:$PATH
`Dockerfile` 使 `COPY` `COPY`
```docker
```dockerfile
COPY requirements.txt /tmp/
RUN pip install --requirement /tmp/requirements.txt
@ -223,7 +223,7 @@ COPY . /tmp/
使 `ADD` URL 使 `curl` `wget`
```docker
```dockerfile
ADD http://example.com/big.tar.xz /usr/src/things/
RUN tar -xJf /usr/src/things/big.tar.xz -C /usr/src/things
@ -233,7 +233,7 @@ RUN make -C /usr/src/things all
使
```docker
```dockerfile
RUN mkdir -p /usr/src/things \
&& curl -SL http://example.com/big.tar.xz \
| tar -xJC /usr/src/things \
@ -250,7 +250,7 @@ RUN mkdir -p /usr/src/things \
`s3cmd`:
```docker
```dockerfile
ENTRYPOINT ["s3cmd"]
CMD ["--help"]
@ -295,7 +295,7 @@ exec "$@"
`ENTRYPOINT`
```docker
```dockerfile
COPY ./docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
@ -339,6 +339,6 @@ $ docker run --rm -it postgres bash
`WORKDIR` 使使 `WORKDIR` `RUN cd ... && do-something`
##
##
Dockerfile https://github.com/docker-library/docs
Dockerfile https://github.com/docker-library/docs

View File

@ -30,7 +30,7 @@
* 使 Dockerfile .dockerignore 使
[Dockerfile ](https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/)
[Dockerfile ](../best_practices.md)
### pull http_proxy
@ -82,7 +82,7 @@ $ docker run --network=my-net --ip=172.25.3.3 -itd --name=my-container busybox
###
`supervisord` https://docs.docker.com/engine/admin/multi-service_container/ 。
`supervisord` https://docs.docker.com/config/containers/multi-service_container/ 。
### CPU
@ -100,7 +100,7 @@ $ docker run --network=my-net --ip=172.25.3.3 -itd --name=my-container busybox
### Docker
使 `upstart` Ubuntu 14.04 `/etc/default/docker`使 `systemd` Ubuntu 16.04Centos `/etc/docker/daemon.json`
使 `systemd` Ubuntu 16.04Centos `/etc/docker/daemon.json`
### Docker

19
appendix/repo/php.md Normal file
View File

@ -0,0 +1,19 @@
## [PHP](https://hub.docker.com/_/php/)
###
[PHP](https://en.wikipedia.org/wiki/php)Hypertext Preprocessor 超文本预处理器的字母缩写)是一种被广泛应用的开放源代码的多用途脚本语言,它可嵌入到 HTML 中,尤其适合 web 开发。
`https://hub.docker.com/_/php/` PHP 5.x ~ 7.x
### 使
PHP
```bash
$ docker run -it --rm -v "$PWD":/app -w /app php:alpine php your-script.php
```
### Dockerfile
https://github.com/docker-library/docs/tree/master/php 查看。

View File

@ -11,13 +11,13 @@
`6379`
```bash
$ docker run --name some-redis -d redis
$ docker run --name some-redis -d -p 6379:6379 redis
```
[](http://redis.io/topics/persistence)。
[](https://redis.io/topics/persistence)。
```bash
$ docker run --name some-redis -d redis redis-server --appendonly yes
$ docker run --name some-redis -d -p 6379:6379 redis redis-server --appendonly yes
```
`VOLUME/data`使 `--volumes-from some-volume-container` `-v /docker/host/dir:/data`

View File

@ -4,7 +4,7 @@
宿 [](https://en.wikipedia.org/wiki/Linux_namespaces)。因此容器可以拥有自己的 `root` 文件系统、自己的网络配置、自己的进程空间,甚至自己的用户 ID 空间。容器内的进程是运行在一个隔离的环境里,使用起来,就好像是在一个独立于宿主的系统下操作一样。这种特性使得容器封装的应用比直接在宿主运行更加安全。也因为这种隔离的特性,很多人初学 Docker 时常常会混淆容器和虚拟机。
使****
使 ****

View File

@ -2,11 +2,11 @@
宿使[Docker Registry](../repository/registry.md)
**Docker Registry** ****`Repository`****`Tag`
**Docker Registry** ****`Repository` ****`Tag`
`<仓库名>:<标签>` `latest`
[Ubuntu ](https://hub.docker.com/_/ubuntu) 为例,`ubuntu` 是仓库的名字,其内包含有不同的版本标签,如,`16.04`, `18.04`。我们可以通过 `ubuntu:14.04`,或者 `ubuntu:18.04` 来具体指定所需哪个版本的镜像。如果忽略了标签,比如 `ubuntu`,那将视为 `ubuntu:latest`。
[Ubuntu ](https://hub.docker.com/_/ubuntu) 为例,`ubuntu` 是仓库的名字,其内包含有不同的版本标签,如,`16.04`, `18.04`。我们可以通过 `ubuntu:16.04`,或者 `ubuntu:18.04` 来具体指定所需哪个版本的镜像。如果忽略了标签,比如 `ubuntu`,那将视为 `ubuntu:latest`。
** `jwilder/nginx-proxy` Docker Registry 使 Docker Registry
@ -14,7 +14,7 @@
Docker Registry 使 Registry
使 Registry [Docker Hub](https://hub.docker.com/),这也是默认的 Registry并拥有大量的高质量的官方镜像。除此以外还有 [CoreOS](https://coreos.com/) 的 [Quay.io](https://quay.io/repository/)CoreOS 相关的镜像存储在这里Google 的 [Google Container Registry](https://cloud.google.com/container-registry/)[Kubernetes](http://kubernetes.io/) 的镜像使用的就是这个服务。
使 Registry [Docker Hub](https://hub.docker.com/),这也是默认的 Registry并拥有大量的高质量的官方镜像。除此以外还有 [CoreOS](https://coreos.com/) 的 [Quay.io](https://quay.io/repository/)CoreOS 相关的镜像存储在这里Google 的 [Google Container Registry](https://cloud.google.com/container-registry/)[Kubernetes](https://kubernetes.io/) 的镜像使用的就是这个服务。
访 Docker Hub `Registry Mirror`**** [](https://cr.console.aliyun.com/#/accelerator)、[DaoCloud 加速器](https://www.daocloud.io/mirror#accelerator-doc) 等。使用加速器会直接从国内的地址下载 Docker Hub 的镜像,比直接从 Docker Hub 下载速度会提高很多。在 [安装 Docker](../install/mirror.md) 一节中有详细的配置方法。
@ -26,4 +26,4 @@ Docker Registry 公开服务是开放给用户使用、允许用户管理镜像
Docker Registry [Docker Registry API](https://docs.docker.com/registry/spec/api/) 的服务端实现,足以支持 `docker` 命令,不影响使用。但不包含图形界面,以及镜像维护、用户管理、访问控制等高级功能。在官方的商业化版本 [Docker Trusted Registry](https://docs.docker.com/datacenter/dtr/2.0/) 中,提供了这些高级功能。
Docker Registry Docker Registry API[VMWare Harbor](https://github.com/vmware/harbor) 和 [Sonatype Nexus](https://www.sonatype.com/docker)。
Docker Registry Docker Registry API[Harbor](https://github.com/goharbor/harbor) 和 [Sonatype Nexus](../repository/nexus3_registry.md)。

View File

@ -0,0 +1,16 @@
language: bash
dist: xenial
services:
- docker
before_script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
script:
- echo "test code"
after_success:
- docker build -t username/alpine .
- docker push username/alpine

View File

@ -0,0 +1,3 @@
FROM alpine
RUN echo "Hello World"

View File

@ -67,7 +67,7 @@ services:
dns: 114.114.114.114
volumes:
drone-data:
drone-data:
```
`${SSL_PATH}` SSL
@ -117,7 +117,7 @@ package main
import "fmt"
func main(){
func main(){
fmt.Printf("Hello World!");
}
```

47
cases/ci/travis.md Normal file
View File

@ -0,0 +1,47 @@
## Travis CI 使 Docker
GitHub [Travis CI](https://travis-ci.com/) 会根据项目根目录 `.travis.yml` 文件设置的指令,执行一系列操作。
Travis CI 使 Docker /CI/CD GitHub Docker Docker Hub
###
https://travis-ci.com/account/repositories 选择 GitHub 仓库,按照指引安装 GitHub App 来启用 GitHub 仓库构建。
`Dockerfile`
```dockerfile
FROM alpine
RUN echo "Hello World"
```
Travis CI `.travis.yml`
```yml
language: bash
dist: xenial
services:
- docker
before_script:
# docker hub
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
script:
#
- echo "test code"
after_success:
#
- docker build -t username/alpine .
- docker push username/alpine
```
> Travis CI `DOCKER_PASSWORD` `DOCKER_USERNAME`
###
GitHub, [Travis CI](https://travis-ci.com/) 查看构建详情。

View File

@ -56,7 +56,7 @@ $ apk --update add --no-cache <package>
###
* `Alpine` http://alpinelinux.org/
* `Alpine` https://www.alpinelinux.org/
* `Alpine` https://github.com/alpinelinux
* `Alpine` https://hub.docker.com/_/alpine/
* `Alpine` https://github.com/gliderlabs/docker-alpine

View File

@ -56,7 +56,6 @@ crashsystems/gitlab-docker A trusted, regularly updated build of GitL.
sylvainlasnier/memcached This is a Memcached 1.4.14 docker images b... 16 [OK]
ubuntu-upstart Upstart is an event-based replacement for ... 16 [OK]
mbentley/ubuntu-django-uwsgi-nginx 16 [OK]
ansible/ubuntu14.04-ansible Ubuntu 14.04 LTS with ansible 15 [OK]
clue/ttrss The Tiny Tiny RSS feed reader allows you t... 14 [OK]
dockerfile/ubuntu-desktop Trusted automated Ubuntu Desktop (LXDE) (h... 14 [OK]
tutum/ubuntu Ubuntu image with SSH access. For the root... 12 [OK]

View File

@ -223,7 +223,7 @@ environment:
- SESSION_SECRET
```
`true|falseyes|no` [](http://yaml.org/type/bool.html) 含义的词汇,最好放到引号里,避免 YAML 自动解析某些内容为对应的布尔语义。这些特定词汇,包括
`true|falseyes|no` [](https://yaml.org/type/bool.html) 含义的词汇,最好放到引号里,避免 YAML 自动解析某些内容为对应的布尔语义。这些特定词汇,包括
```bash
y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF

View File

@ -1,6 +1,6 @@
## 使 Django
`Python`
> `Python`
使 `Docker Compose` `Django/PostgreSQL`
@ -8,7 +8,7 @@
Docker `Dockerfile` Docker
```docker
```dockerfile
FROM python:3
ENV PYTHONUNBUFFERED 1
RUN mkdir /code

View File

@ -1,6 +1,6 @@
## 使 Rails
`Ruby`
> `Ruby`
使 `Compose` `Rails/PostgreSQL`
@ -8,7 +8,7 @@
Docker `Dockerfile` Docker
```docker
```dockerfile
FROM ruby
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev
RUN mkdir /myapp

View File

@ -40,7 +40,7 @@ if __name__ == "__main__":
`Dockerfile`
```docker
```dockerfile
FROM python:3.6-alpine
ADD . /code
WORKDIR /code
@ -60,7 +60,7 @@ services:
build: .
ports:
- "5000:5000"
redis:
image: "redis:alpine"
```

View File

@ -1,6 +1,6 @@
## 使 WordPress
`PHP`
> `PHP`
`Compose` 便 `Wordpress`

View File

@ -6,7 +6,7 @@
### `attach`
`docker attach` Docker 使
使 `docker attach`
```bash
$ docker run -dit ubuntu

View File

@ -13,10 +13,8 @@ UUID APP IMAGE NAME STATE CREATED STARTED NETWORKS
57581644 etcd quay.io/coreos/etcd:v3.2.10 running 1 minute ago 1 minute ago
```
`etcd` 使 [etcd ](../etcd/)
`etcd` 使 [etcd ](../etcd/)
##
`Docker``CoreOS` `Docker`使
`CoreOS` `Rkt``Rkt`

View File

@ -69,7 +69,7 @@ $ docker run --rm -it \
root@2affd44b4667:/# history
1 ls
2 diskutil list
2 diskutil list
```

View File

@ -14,7 +14,7 @@ services:
- node1-data:/etcd-data
expose:
- 2379
- 2380
- 2380
networks:
cluster_net:
ipv4_address: 172.16.238.100

View File

@ -7,7 +7,7 @@ services:
- node1-data:/etcd-data
expose:
- 2379
- 2380
- 2380
networks:
cluster_net:
ipv4_address: 172.16.238.100

View File

@ -6,7 +6,7 @@
`etcd` [github.com/coreos/etcd](https://github.com/coreos/etcd) 进行维护。
[Apache ZooKeeper](http://zookeeper.apache.org/) 项目和 [doozer](https://github.com/ha/doozerd) 项目的启发,`etcd` 在设计的时候重点考虑了下面四个要素:
[Apache ZooKeeper](https://zookeeper.apache.org/) 项目和 [doozer](https://github.com/ha/doozerd) 项目的启发,`etcd` 在设计的时候重点考虑了下面四个要素:
* `API` ([gRPC](https://github.com/grpc/grpc))

View File

@ -2,7 +2,7 @@
`docker commit` Dockerfile
Dockerfile **(Instruction)**
Dockerfile **(Instruction)**
`nginx` 使 Dockerfile
@ -25,7 +25,7 @@ RUN echo '<h1>Hello, Docker!</h1>' > /usr/share/nginx/html/index.html
### FROM
`nginx` `FROM` **** `Dockerfile` `FROM`
`nginx` `FROM` **** `Dockerfile` `FROM`
[Docker Hub](https://hub.docker.com/search?q=&type=image&image_filter=official) 上有非常多的高质量的官方镜像,有可以直接拿来使用的服务类的镜像,如 [`nginx`](https://hub.docker.com/_/nginx/)、[`redis`](https://hub.docker.com/_/redis/)、[`mongo`](https://hub.docker.com/_/mongo/)、[`mysql`](https://hub.docker.com/_/mysql/)、[`httpd`](https://hub.docker.com/_/httpd/)、[`php`](https://hub.docker.com/_/php/)、[`tomcat`](https://hub.docker.com/_/tomcat/) 等;也有一些方便开发、构建、运行各种语言应用的镜像,如 [`node`](https://hub.docker.com/_/node)、[`openjdk`](https://hub.docker.com/_/openjdk/)、[`python`](https://hub.docker.com/_/python/)、[`ruby`](https://hub.docker.com/_/ruby/)、[`golang`](https://hub.docker.com/_/golang/) 等。可以在其中寻找一个最符合我们最终目标的镜像为基础镜像进行定制。
@ -132,9 +132,9 @@ docker build [选项] <上下文路径/URL/->
### Context
`docker build` `.``.` `Dockerfile` `Dockerfile` ****
`docker build` `.``.` `Dockerfile` `Dockerfile` ****
`docker build` Docker Docker Docker REST API [Docker Remote API](https://docs.docker.com/engine/reference/api/docker_remote_api/),而如 `docker` 命令这样的客户端工具,则是通过这组 API 与 Docker 引擎交互,从而完成各种功能。因此,虽然表面上我们好像是在本机执行各种 `docker` 功能但实际上一切都是使用的远程调用形式在服务端Docker 引擎)完成。也因为这种 C/S 设计,让我们操作远程服务器的 Docker 引擎变得轻而易举。
`docker build` Docker Docker Docker REST API [Docker Remote API](https://docs.docker.com/develop/sdk/),而如 `docker` 命令这样的客户端工具,则是通过这组 API 与 Docker 引擎交互,从而完成各种功能。因此,虽然表面上我们好像是在本机执行各种 `docker` 功能但实际上一切都是使用的远程调用形式在服务端Docker 引擎)完成。也因为这种 C/S 设计,让我们操作远程服务器的 Docker 引擎变得轻而易举。
`RUN` `COPY` `ADD` `docker build` Docker /

178
image/buildkit.md Normal file
View File

@ -0,0 +1,178 @@
## 使 `BuildKit`
**BuildKit** https://github.com/moby/buildkit 开源。
**使Docker Hub Docker 18.09BuildKit 使使 BuildKit 使 Dockerfile Dockerfile.buildkit**
**docker-compose build BuildKit**
Docker CE 18.09+ 使 `BuildKit` `Dockerfile` Docker
### `BuildKit`
`BuildKit` ****
LinuxmacOS
```bash
$ export DOCKER_BUILDKIT=1
```
Windows
```powershell
$ set $env:DOCKER_BUILDKIT=1
```
> 使
### `Dockerfile`
`BuildKit` 使
#### `RUN --mount=type=cache`
使 `Go` `go mod``Node.js` `npm`
`npm`
```docker
FROM node:alpine as builder
WORKDIR /app
COPY package.json /app/
RUN npm i --registry=https://registry.npm.taobao.org \
&& rm -rf ~/.npm
COPY src /app/src
RUN npm run build
FROM nginx:alpine
COPY --from=builder /app/dist /app/dist
```
使 `dist` `package.json` `RUN npm i && rm -rf ~/.npm`
**** `node_modules` `node_modules` `node_modules`
`BuildKit` `RUN --mount=type=cache`
```docker
# syntax = docker/dockerfile:experimental
FROM node:alpine as builder
WORKDIR /app
COPY package.json /app/
RUN --mount=type=cache,target=/app/node_modules,id=my_app_npm_module,sharing=locked \
--mount=type=cache,target=/root/.npm,id=npm_cache \
npm i --registry=https://registry.npm.taobao.org
COPY src /app/src
RUN --mount=type=cache,target=/app/node_modules,id=my_app_npm_module,sharing=locked \
# --mount=type=cache,target=/app/dist,id=my_app_dist,sharing=locked \
npm run build
FROM nginx:alpine
# COPY --from=builder /app/dist /app/dist
# from source 使 RUN
RUN --mount=type=cache,target=/tmp/dist,from=builder,source=/app/dist \
# --mount=type=cache,target/tmp/dist,from=my_app_dist,sharing=locked \
mkdir -p /app/dist && cp -r /tmp/dist/* /app/dist
```
** `BuildKit` `Dockerfile` **
```docker
# syntax = docker/dockerfile:experimental
```
`RUN` `id` `my_app_npm_module` `/app/node_modules`
`RUN` `node_modules` `node_modules`
`RUN` `from` `builder` `source`
`Dockerfile` `--mount=type=cache,...`
|Option |Description|
|---------------------|-----------|
|`id` | `id` 便|
|`target` () | |
|`ro`,`readonly` | |
|`sharing` | `shared` `private` `locked` `sharing` 使 `BuildKit` 使 `id``shared` `private` 使使`locked` 使|
|`from` | |
|`source` | |
#### `RUN --mount=type=bind`
```docker
# syntax = docker/dockerfile:experimental
RUN --mount=type=bind,from=php:alpine,source=/usr/local/bin/docker-php-entrypoint,target=/docker-php-entrypoint \
cat /docker-php-entrypoint
```
#### `RUN --mount=type=tmpfs`
`tmpfs`
```docker
# syntax = docker/dockerfile:experimental
RUN --mount=type=tmpfs,target=/temp \
mount | grep /temp
```
#### `RUN --mount=type=secret`
```docker
# syntax = docker/dockerfile:experimental
RUN --mount=type=secret,id=aws,target=/root/.aws/credentials \
cat /root/.aws/credentials
```
```bash
$ docker build -t test --secret id=aws,src=$HOME/.aws/credentials .
```
#### `RUN --mount=type=ssh`
`ssh`
```docker
# syntax = docker/dockerfile:experimental
FROM alpine
RUN apk add --no-cache openssh-client
RUN mkdir -p -m 0700 ~/.ssh && ssh-keyscan gitlab.com >> ~/.ssh/known_hosts
RUN --mount=type=ssh ssh git@gitlab.com | tee /hello
```
```bash
$ eval $(ssh-agent)
$ ssh-add ~/.ssh/id_rsa
(Input your passphrase here)
$ docker build -t test --ssh default=$SSH_AUTH_SOCK .
```
###
```bash
$ docker builder prune
```
###
* https://github.com/moby/buildkit/blob/master/frontend/dockerfile/docs/experimental.md

View File

@ -126,6 +126,6 @@ docker run --name web2 -d -p 81:80 nginx:v2
`docker diff webserver` `/usr/share/nginx/html/index.html`
使 `docker commit` ****使 `docker diff` 线
使 `docker commit` ****使 `docker diff` 线
使使 `docker commit` 西使访

View File

@ -0,0 +1,16 @@
FROM node:alpine as builder
WORKDIR /app
COPY package.json /app/
RUN npm i --registry=https://registry.npm.taobao.org \
&& rm -rf ~/.npm
COPY src /app/src
RUN npm run build
FROM nginx:alpine
COPY --from=builder /app/dist /app/dist

View File

@ -0,0 +1,37 @@
# syntax = docker/dockerfile:experimental
FROM node:alpine as builder
WORKDIR /app
COPY package.json /app/
RUN --mount=type=cache,target=/app/node_modules,id=my_app_npm_module,sharing=locked \
--mount=type=cache,target=/root/.npm,id=npm_cache \
npm i --registry=https://registry.npm.taobao.org
COPY src /app/src
RUN --mount=type=cache,target=/app/node_modules,id=my_app_npm_module,sharing=locked \
# --mount=type=cache,target=/app/dist,id=my_app_dist,sharing=locked \
npm run build
FROM nginx:alpine
# COPY --from=builder /app/dist /app/dist
# from source 使 RUN
RUN --mount=type=cache,target=/tmp/dist,from=builder,source=/app/dist \
# --mount=type=cache,target/tmp/dist,from=my_app_dist,sharing=locked \
mkdir -p /app/dist && cp -r /tmp/dist/* /app/dist
RUN --mount=type=bind,from=php:alpine,source=/usr/local/bin/docker-php-entrypoint,target=/docker-php-entrypoint \
cat /docker-php-entrypoint
RUN --mount=type=tmpfs,target=/temp \
mount | grep /temp
RUN --mount=type=secret,id=aws,target=/root/.aws/credentials \
cat /root/.aws/credentials
# docker build -t test --secret id=aws,src=$PWD/aws.txt --progress=plain -f Dockerfile.buildkit .

View File

@ -0,0 +1 @@
awskey

View File

@ -0,0 +1,11 @@
{
"name": "my_app",
"version": "19.6.0",
"devDependencies": {
"webpack": "*",
"webpack-cli": "*"
},
"scripts": {
"build": "mkdir -p $PWD/dist && cp -r src/* dist/"
}
}

View File

@ -0,0 +1 @@
console.log(1);

View File

@ -28,7 +28,7 @@ CMD [ "sh", "-c", "echo $HOME" ]
`CMD`
Docker upstart/systemd
Docker `systemd`
`CMD`

View File

@ -2,6 +2,6 @@
* `Dockerfie` https://docs.docker.com/engine/reference/builder/
* `Dockerfile` https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/
* `Dockerfile` https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
* `Docker` `Dockerfile`https://github.com/docker-library/docs

View File

@ -2,7 +2,7 @@
Docker
Docker 使 [Union FS](http://en.wikipedia.org/wiki/UnionFS) 将这些不同的层结合到一个镜像中去。
Docker 使 [Union FS](https://en.wikipedia.org/wiki/UnionFS) 将这些不同的层结合到一个镜像中去。
Union FS , LVMRAID disk ,Live CD

View File

@ -15,7 +15,7 @@ ubuntu latest f753707788c5 4 weeks ago
`仓库名``标签``镜像 ID``创建时间` `所占用的空间`
** ID** **** `ubuntu:18.04` `ubuntu:latest` ID
** ID** **** `ubuntu:18.04` `ubuntu:latest` ID
###

178
image/manifest.md Normal file
View File

@ -0,0 +1,178 @@
## Docker -- docker manifest
使 Docker 宿 `Linux x86_64` 使 `Linux x86_64`
> macOS 使 [binfmt_misc](https://docs.docker.com/docker-for-mac/multi-arch/) 提供了多种架构支持,在 macOS 系统上 (x86_64) 可以运行 arm 等其他架构的镜像。
`Linux x86_64` `username/test`
```Dockerfile
FROM alpine
CMD echo 1
```
Docker Hub `Linux arm64v8` 使
```bash
$ docker run -it --rm username/test
```
`Linux x86_64` `Linux arm64v8` `username/test` `username/arm64v8-test` 使
Docker
`Linux x86_64` `Linux arm64v8` `$ docker run golang:alpine go version`
`golang:alpine` [`manifest` ](https://docs.docker.com/registry/spec/manifest-v2-2/)。
Docker `manifest` Docker Docker `golang:alpine` `username/test`
使 `$ docker manifest inspect golang:alpine` `manifest`
**** 使
```bash
# LinuxmacOS
$ export DOCKER_CLI_EXPERIMENTAL=enabled
# Windows
$ set $env:DOCKER_CLI_EXPERIMENTAL=enabled
```
> 使
```bash
$ docker manifest inspect golang:alpine
```
```json
{
"schemaVersion": 2,
"mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
"manifests": [
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 1365,
"digest": "sha256:5e28ac423243b187f464d635bcfe1e909f4a31c6c8bce51d0db0a1062bec9e16",
"platform": {
"architecture": "amd64",
"os": "linux"
}
},
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 1365,
"digest": "sha256:2945c46e26c9787da884b4065d1de64cf93a3b81ead1b949843dda1fcd458bae",
"platform": {
"architecture": "arm",
"os": "linux",
"variant": "v7"
}
},
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 1365,
"digest": "sha256:87fff60114fd3402d0c1a7ddf1eea1ded658f171749b57dc782fd33ee2d47b2d",
"platform": {
"architecture": "arm64",
"os": "linux",
"variant": "v8"
}
},
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 1365,
"digest": "sha256:607b43f1d91144f82a9433764e85eb3ccf83f73569552a49bc9788c31b4338de",
"platform": {
"architecture": "386",
"os": "linux"
}
},
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 1365,
"digest": "sha256:25ead0e21ed5e246ce31e274b98c09aaf548606788ef28eaf375dc8525064314",
"platform": {
"architecture": "ppc64le",
"os": "linux"
}
},
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 1365,
"digest": "sha256:69f5907fa93ea591175b2c688673775378ed861eeb687776669a48692bb9754d",
"platform": {
"architecture": "s390x",
"os": "linux"
}
}
]
}
```
`manifest` `digest` Docker 使 `manifest` ( `golang:alpine`)
使 `$ docker manifest` `manifest` Docker Hub
###
`Linux x86_64` `username/x8664-test` `Linux arm64v8` `username/arm64v8-test` Docker Hub
### `manifest`
```bash
# $ docker manifest create MANIFEST_LIST MANIFEST [MANIFEST...]
$ docker manifest create username/test \
username/x8664-test \
username/arm64v8-test
```
`manifest` `-a,--amend`
### `manifest`
```bash
# $ docker manifest annotate [OPTIONS] MANIFEST_LIST MANIFEST
$ docker manifest annotate username/test \
username/x8664-test \
--os linux --arch x86_64
$ docker manifest annotate username/test \
username/arm64v8-test \
--os linux --arch arm64 --variant v8
```
`manifest`
### `manifest`
```bash
$ docker manifest inspect username/test
```
### `manifest`
Docker Hub
```bash
$ docker manifest push username/test
```
###
`Linux x86_64` `Linux arm64v8` `$ docker run -it --rm username/test`
###
`manifest`
* https://blog.docker.com/2017/11/multi-arch-all-the-things/

View File

@ -8,29 +8,25 @@
`Dockerfile`
* `Dockerfile`
*
*
`app.go` `Hello World!`
`app.go` `Hello World!`
```go
package main
package main
import "fmt"
import "fmt"
func main(){
func main(){
fmt.Printf("Hello World!");
}
```
`Dockerfile.one`
```docker
```dockerfile
FROM golang:1.9-alpine
RUN apk --no-cache add git ca-certificates
@ -58,11 +54,9 @@ $ docker build -t go/helloworld:1 -f Dockerfile.one .
`Dockerfile` `Dockerfile`
`Dockerfile.build`
`Dockerfile.build`
```docker
```dockerfile
FROM golang:1.9-alpine
RUN apk --no-cache add git
@ -77,7 +71,7 @@ RUN go get -d -v github.com/go-sql-driver/mysql \
`Dockerfile.copy`
```docker
```dockerfile
FROM alpine:latest
RUN apk --no-cache add ca-certificates
@ -129,11 +123,9 @@ go/helloworld 1 f55d3e16affc 2 minutes ago 295MB
Docker v17.05 (`multistage builds`)使 `Dockerfile`
`Dockerfile`
`Dockerfile`
```docker
```dockerfile
FROM golang:1.9-alpine as builder
RUN apk --no-cache add git
@ -154,7 +146,7 @@ WORKDIR /root/
COPY --from=0 /go/src/github.com/go/helloworld/app .
CMD ["./app"]
CMD ["./app"]
```
@ -184,7 +176,7 @@ go/helloworld 1 f55d3e16affc 2 minutes ago 295MB
FROM golang:1.9-alpine as builder
```
`builder` 使 `docker build` `--target`
`builder` `--target=builder`
```bash
$ docker build --target builder -t username/imagename:tag .

View File

@ -0,0 +1,12 @@
.idea/
.git/
vendor/
node_modules/
public/js/
public/css/
yarn-error.log
bootstrap/cache/*
storage/
# .env.*

View File

@ -0,0 +1,53 @@
FROM node:alpine as frontend
COPY package.json /app/
RUN cd /app \
&& npm install --registry=https://registry.npm.taobao.org
COPY webpack.mix.js /app/
COPY resources/assets/ /app/resources/assets/
RUN cd /app \
&& npm run production
FROM composer as composer
COPY database/ /app/database/
COPY composer.json /app/
RUN cd /app \
&& composer config -g repo.packagist composer https://packagist.laravel-china.org \
&& composer install \
--ignore-platform-reqs \
--no-interaction \
--no-plugins \
--no-scripts \
--prefer-dist
FROM php:7.2-fpm-alpine as laravel
ARG LARAVEL_PATH=/app/laravel
COPY --from=composer /app/vendor/ ${LARAVEL_PATH}/vendor/
COPY . ${LARAVEL_PATH}
COPY --from=frontend /app/public/js/ ${LARAVEL_PATH}/public/js/
COPY --from=frontend /app/public/css/ ${LARAVEL_PATH}/public/css/
COPY --from=frontend /app/mix-manifest.json ${LARAVEL_PATH}/mix-manifest.json
RUN cd ${LARAVEL_PATH} \
&& php artisan package:discover \
&& mkdir -p storage \
&& mkdir -p storage/framework/cache \
&& mkdir -p storage/framework/sessions \
&& mkdir -p storage/framework/testing \
&& mkdir -p storage/framework/views \
&& mkdir -p storage/logs \
&& chmod -R 777 storage
FROM nginx:alpine as nginx
ARG LARAVEL_PATH=/app/laravel
COPY laravel.conf /etc/nginx/conf.d/
COPY --from=laravel ${LARAVEL_PATH}/public ${LARAVEL_PATH}/public

View File

@ -0,0 +1,18 @@
server {
listen 80 default_server;
root /app/laravel/public;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ .*\.php(\/.*)*$ {
fastcgi_pass laravel:9000;
include fastcgi.conf;
# fastcgi_connect_timeout 300;
# fastcgi_send_timeout 300;
# fastcgi_read_timeout 300;
}
}

View File

@ -0,0 +1,221 @@
## Laravel
> PHP
###
`Laravel` `Laravel` `Dockerfile` `.dockerignore` `laravel.conf`
`.dockerignore`
```bash
.idea/
.git/
vendor/
node_modules/
public/js/
public/css/
yarn-error.log
bootstrap/cache/*
storage/
# .env.*
```
`laravel.conf` nginx
```nginx
server {
listen 80 default_server;
root /app/laravel/public;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ .*\.php(\/.*)*$ {
fastcgi_pass laravel:9000;
include fastcgi.conf;
# fastcgi_connect_timeout 300;
# fastcgi_send_timeout 300;
# fastcgi_read_timeout 300;
}
}
```
###
```dockerfile
FROM node:alpine as frontend
COPY package.json /app/
RUN cd /app \
&& npm install --registry=https://registry.npm.taobao.org
COPY webpack.mix.js /app/
COPY resources/assets/ /app/resources/assets/
RUN cd /app \
&& npm run production
```
### Composer
Composer
```dockerfile
FROM composer as composer
COPY database/ /app/database/
COPY composer.json composer.lock /app/
RUN cd /app \
&& composer config -g repo.packagist composer https://packagist.laravel-china.org \
&& composer install \
--ignore-platform-reqs \
--no-interaction \
--no-plugins \
--no-scripts \
--prefer-dist
```
###
```dockerfile
FROM php:7.2-fpm-alpine as laravel
ARG LARAVEL_PATH=/app/laravel
COPY --from=composer /app/vendor/ ${LARAVEL_PATH}/vendor/
COPY . ${LARAVEL_PATH}
COPY --from=frontend /app/public/js/ ${LARAVEL_PATH}/public/js/
COPY --from=frontend /app/public/css/ ${LARAVEL_PATH}/public/css/
COPY --from=frontend /app/mix-manifest.json ${LARAVEL_PATH}/mix-manifest.json
RUN cd ${LARAVEL_PATH} \
&& php artisan package:discover \
&& mkdir -p storage \
&& mkdir -p storage/framework/cache \
&& mkdir -p storage/framework/sessions \
&& mkdir -p storage/framework/testing \
&& mkdir -p storage/framework/views \
&& mkdir -p storage/logs \
&& chmod -R 777 storage
```
### NGINX
```dockerfile
FROM nginx:alpine as nginx
ARG LARAVEL_PATH=/app/laravel
COPY laravel.conf /etc/nginx/conf.d/
COPY --from=laravel ${LARAVEL_PATH}/public ${LARAVEL_PATH}/public
```
### Laravel Nginx
使 `docker build`
```bash
$ docker build -t my/laravel --target=laravel .
$ docker build -t my/nginx --target=nginx .
```
###
Docker
```bash
$ docker network create laravel
```
laravel `--name=laravel` `nginx` `fastcgi_pass laravel:9000;`
```bash
$ docker run -it --rm --name=laravel --network=laravel my/laravel
```
nginx
```bash
$ docker run -it --rm --network=laravel -p 8080:80 my/nginx
```
访 `127.0.0.1:8080` Laravel
> Laravel redisMySQL
###
便使 **** `config` `secret` `Swarm mode` `Kubernetes`
###
`Dockerfile`
```dockerfile
FROM node:alpine as frontend
COPY package.json /app/
RUN cd /app \
&& npm install --registry=https://registry.npm.taobao.org
COPY webpack.mix.js /app/
COPY resources/assets/ /app/resources/assets/
RUN cd /app \
&& npm run production
FROM composer as composer
COPY database/ /app/database/
COPY composer.json /app/
RUN cd /app \
&& composer config -g repo.packagist composer https://packagist.laravel-china.org \
&& composer install \
--ignore-platform-reqs \
--no-interaction \
--no-plugins \
--no-scripts \
--prefer-dist
FROM php:7.2-fpm-alpine as laravel
ARG LARAVEL_PATH=/app/laravel
COPY --from=composer /app/vendor/ ${LARAVEL_PATH}/vendor/
COPY . ${LARAVEL_PATH}
COPY --from=frontend /app/public/js/ ${LARAVEL_PATH}/public/js/
COPY --from=frontend /app/public/css/ ${LARAVEL_PATH}/public/css/
COPY --from=frontend /app/mix-manifest.json ${LARAVEL_PATH}/mix-manifest.json
RUN cd ${LARAVEL_PATH} \
&& php artisan package:discover \
&& mkdir -p storage \
&& mkdir -p storage/framework/cache \
&& mkdir -p storage/framework/sessions \
&& mkdir -p storage/framework/testing \
&& mkdir -p storage/framework/views \
&& mkdir -p storage/logs \
&& chmod -R 777 storage
FROM nginx:alpine as nginx
ARG LARAVEL_PATH=/app/laravel
COPY laravel.conf /etc/nginx/conf.d/
COPY --from=laravel ${LARAVEL_PATH}/public ${LARAVEL_PATH}/public
```

View File

@ -8,32 +8,33 @@
Web `/`
[OpenVZ](https://openvz.org) 的 Ubuntu 14.04 [模板](https://openvz.org/Download/template/precreated)的镜像:
[OpenVZ](https://openvz.org) 的 Ubuntu 16.04 [模板](https://openvz.org/Download/template/precreated)的镜像:
```bash
$ docker import \
http://download.openvz.org/template/precreated/ubuntu-14.04-x86_64-minimal.tar.gz \
openvz/ubuntu:14.04
Downloading from http://download.openvz.org/template/precreated/ubuntu-14.04-x86_64-minimal.tar.gz
sha256:f477a6e18e989839d25223f301ef738b69621c4877600ae6467c4e5289822a79B/78.42 MB
http://download.openvz.org/template/precreated/ubuntu-16.04-x86_64.tar.gz \
openvz/ubuntu:16.04
Downloading from http://download.openvz.org/template/precreated/ubuntu-16.04-x86_64.tar.gz
sha256:412b8fc3e3f786dca0197834a698932b9c51b69bd8cf49e100c35d38c9879213
```
`ubuntu-14.04-x86_64-minimal.tar.gz` `openvz/ubuntu:14.04`
`ubuntu-16.04-x86_64.tar.gz` `openvz/ubuntu:16.04`
`docker image ls`
```bash
$ docker image ls openvz/ubuntu
REPOSITORY TAG IMAGE ID CREATED SIZE
openvz/ubuntu 14.04 f477a6e18e98 55 seconds ago 214.9 MB
openvz/ubuntu 16.04 412b8fc3e3f7 55 seconds ago 505MB
```
```bash
$ docker history openvz/ubuntu:14.04
$ docker history openvz/ubuntu:16.04
IMAGE CREATED CREATED BY SIZE COMMENT
f477a6e18e98 About a minute ago 214.9 MB Imported from http://download.openvz.org/template/precreated/ubuntu-14.04-x86_64-minimal.tar.gz
f477a6e18e98 About a minute ago 214.9 MB Imported from http://download.openvz.org/template/precreated/ubuntu-16.04-x86_64.tar.gz
```
### `docker save` `docker load`

View File

@ -64,7 +64,7 @@ UBUNTU_CODENAME=bionic
* `-it` `-i` `-t` `bash`
* `--rm`退退 `docker rm`便使 `--rm`
* `ubuntu:18.04` `ubuntu:18.04`
* `bash`**** Shell `bash`
* `bash` **** Shell `bash`
Shell `cat /etc/os-release` Linux `Ubuntu 18.04.1 LTS`

View File

@ -48,7 +48,7 @@ $ sudo yum-config-manager \
#
# $ sudo yum-config-manager \
# --add-repo \
# https://download.docker.com/linux/centos/docker-ce.repo
# https://download.docker.com/linux/centos/docker-ce.repo
```
Docker CE 使
@ -145,11 +145,11 @@ For more examples and ideas, visit:
###
Docker Docker [](mirror.md)
使 Docker Docker [](mirror.md)
###
CentOS 使 Docker CE
CentOS 使 Docker CE
```bash
WARNING: bridge-nf-call-iptables is disabled

View File

@ -10,8 +10,6 @@ Docker CE 支持以下版本的 [Debian](https://www.debian.org/intro/about) 操
* Buster 10
* Stretch 9
* Jessie 8 (LTS) (Docker CE v18.06 )
* Wheezy 7.7 (EOL) (Docker CE v18.03 )
####
@ -23,16 +21,10 @@ $ sudo apt-get remove docker \
docker.io
```
#### Debian 7 Wheezy
Debian 7 3.2 Docker CE [`backports`](https://backports.debian.org/Instructions/) 的内核。
### 使 APT
apt 使 HTTPS 使 HTTPS CA
Debian 8 Jessie Debian 9 Stretch 使:
```bash
$ sudo apt-get update
@ -45,20 +37,6 @@ $ sudo apt-get install \
software-properties-common
```
Debian 7 Wheezy 使
```bash
$ sudo apt-get update
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
lsb-release \
python-software-properties
```
使
GPG
@ -83,19 +61,11 @@ $ sudo add-apt-repository \
# $ sudo add-apt-repository \
# "deb [arch=amd64] https://download.docker.com/linux/debian \
# $(lsb_release -cs) \
# stable"
# stable"
```
> Docker CE APT Docker CE stable test nightly
Debian 7
`/etc/apt/sources.list` deb-src 使 #
```bash
deb-src [arch=amd64] https://download.docker.com/linux/debian wheezy stable
```
#### Docker CE
apt `docker-ce`
@ -124,12 +94,6 @@ $ sudo systemctl enable docker
$ sudo systemctl start docker
```
Debian 7 Wheezy 使
```bash
$ sudo service docker start
```
### docker
`docker` 使 [Unix socket](https://en.wikipedia.org/wiki/Unix_domain_socket) 与 Docker 引擎通讯。而只有 `root` 用户和 `docker` 组的用户才可以访问 Docker 引擎的 Unix socket。出于安全考虑一般 Linux 系统上不会直接使用 `root` 用户。因此,更好地做法是将需要使用 `docker` 的用户加入 `docker` 用户组。
@ -185,7 +149,7 @@ For more examples and ideas, visit:
###
Docker Docker [](mirror.md)
使 Docker Docker [](mirror.md)
###

View File

@ -39,7 +39,7 @@ $ sudo dnf -y install dnf-plugins-core
使
`dnf
`dnf`
```bash
$ sudo dnf config-manager \
@ -163,7 +163,7 @@ For more examples and ideas, visit:
###
Docker Docker [](mirror.md)
使 Docker Docker [](mirror.md)
###

View File

@ -2,13 +2,13 @@
###
[Docker for Mac](https://docs.docker.com/docker-for-mac/) 要求系统最低为 macOS 10.10.3 Yosemite。如果系统不满足需求可以安装 [Docker Toolbox](https://docs.docker.com/toolbox/overview/)
[Docker for Mac](https://docs.docker.com/docker-for-mac/) 要求系统最低为 macOS El Capitan 10.11
###
#### 使 Homebrew
[Homebrew](http://brew.sh/) 的 [Cask](https://caskroom.github.io/) 已经支持 Docker for Mac因此可以很方便的使用 Homebrew Cask 来进行安装:
[Homebrew](https://brew.sh/) 的 [Cask](https://caskroom.github.io/) 已经支持 Docker for Mac因此可以很方便的使用 Homebrew Cask 来进行安装:
```bash
$ brew cask install docker
@ -44,11 +44,11 @@ $ brew cask install docker
```bash
$ docker --version
Docker version 17.10.0-ce, build f4ffd25
Docker version 18.09.0, build 4d60db4
$ docker-compose --version
docker-compose version 1.17.0-rc1, build a0f95af
docker-compose version 1.23.2, build 1110ad01
$ docker-machine --version
docker-machine version 0.13.0, build 9ba6da9
docker-machine version 0.16.0, build 702c267f
```
`docker version``docker info` [Nginx ](https://hub.docker.com/_/nginx/)
@ -70,4 +70,4 @@ $ docker rm webserver
###
Docker Docker [](mirror.md)
使 Docker Docker [](mirror.md)

View File

@ -3,6 +3,7 @@
Docker Hub Docker
* [Docker registry mirror `https://registry.docker-cn.com`](https://docs.docker.com/registry/recipes/mirror/#use-case-the-china-registry-mirror)
* [()](https://cr.console.aliyun.com/cn-hangzhou/mirrors)
* [ `https://reg-mirror.qiniu.com/`](https://kirk-enterprise.github.io/hub-docs/#/user-guide/mirror)
>
@ -11,20 +12,6 @@
Docker `https://registry.docker-cn.com`
### Ubuntu 14.04Debian 7 Wheezy
使 [upstart](http://upstart.ubuntu.com/) 的系统而言,编辑 `/etc/default/docker` 文件,在其中的 `DOCKER_OPTS` 中配置加速器地址:
```bash
DOCKER_OPTS="--registry-mirror=https://registry.docker-cn.com"
```
```bash
$ sudo service docker restart
```
### Ubuntu 16.04+Debian 8+CentOS 7
使 [systemd](https://www.freedesktop.org/wiki/Software/systemd/) 的系统,请在 `/etc/docker/daemon.json` 中写入如下内容(如果文件不存在请新建该文件)
@ -58,7 +45,7 @@ $ sudo systemctl restart docker
###
`docker info`
`docker info`
```bash
Registry Mirrors:

View File

@ -55,7 +55,7 @@ $ sudo add-apt-repository \
# $ sudo add-apt-repository \
# "deb [arch=armhf] https://download.docker.com/linux/raspbian \
# $(lsb_release -cs) \
# stable"
# stable"
```
> Docker CE APT Docker CE stable test nightly
@ -145,4 +145,4 @@ For more examples and ideas, visit:
###
Docker Docker [](mirror.md)
使 Docker Docker [](mirror.md)

View File

@ -10,7 +10,6 @@ Docker CE 支持以下版本的 [Ubuntu](https://www.ubuntu.com/server) 操作
* Bionic 18.04 (LTS)
* Xenial 16.04 (LTS)
* Trusty 14.04 (LTS) (Docker CE v18.06 )
Docker CE 64 x86 ARM Ubuntu LTSLong-Term-Support 5 使 LTS
@ -24,24 +23,6 @@ $ sudo apt-get remove docker \
docker.io
```
#### Ubuntu 14.04
Ubuntu 14.04 (`linux-image-extra-*`) `AUFS` Docker 使 `AUFS`
```bash
$ sudo apt-get update
$ sudo apt-get install \
linux-image-extra-$(uname -r) \
linux-image-extra-virtual
```
#### Ubuntu 16.04 +
Ubuntu 16.04 + Docker CE 使 `overlay2` ,
### 使 APT
`apt` 使 HTTPS 使 HTTPS CA
@ -81,7 +62,7 @@ $ sudo add-apt-repository \
# $ sudo add-apt-repository \
# "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
# $(lsb_release -cs) \
# stable"
# stable"
```
> Docker CE APT Docker CE stable test nightly
@ -114,12 +95,6 @@ $ sudo systemctl enable docker
$ sudo systemctl start docker
```
Ubuntu 14.04 使
```bash
$ sudo service docker start
```
### docker
`docker` 使 [Unix socket](https://en.wikipedia.org/wiki/Unix_domain_socket) 与 Docker 引擎通讯。而只有 `root` 用户和 `docker` 组的用户才可以访问 Docker 引擎的 Unix socket。出于安全考虑一般 Linux 系统上不会直接使用 `root` 用户。因此,更好地做法是将需要使用 `docker` 的用户加入 `docker` 用户组。
@ -175,7 +150,7 @@ For more examples and ideas, visit:
###
Docker Docker [](mirror.md)
使 Docker Docker [](mirror.md)
###

View File

@ -26,4 +26,4 @@ Docker CE 启动之后会在 Windows 任务栏出现鲸鱼图标。
###
Docker Docker [](mirror.md)
使 Docker Docker [](mirror.md)

View File

@ -2,7 +2,7 @@
Docker dotCloud Solomon Hykes dotCloud [2013 3 Apache 2.0 ][docker-soft] [GitHub](https://github.com/moby/moby) 上进行维护。Docker 项目后来还加入了 Linux 基金会,并成立推动 [开放容器联盟OCI](https://www.opencontainers.org/)。
Docker 广 GitHub 4 6 fork Docker 2013 [dotCloud Docker](https://blog.docker.com/2013/10/dotcloud-is-becoming-docker-inc/)。Docker 最初是在 Ubuntu 12.04 上开发实现的Red Hat 则从 RHEL 6.5 开始对 Docker 进行支持Google 也在其 PaaS 产品中广泛应用 Docker。
Docker 广 [GitHub ](https://github.com/moby/moby) 已经超过 5 万 2 千个星标和一万多个 fork。甚至由于 Docker 项目的火爆,在 2013 年底,[dotCloud 公司决定改名为 Docker](https://blog.docker.com/2013/10/dotcloud-is-becoming-docker-inc/)。Docker 最初是在 Ubuntu 12.04 上开发实现的Red Hat 则从 RHEL 6.5 开始对 Docker 进行支持Google 也在其 PaaS 产品中广泛应用 Docker。
Docker 使 Google [Go ](https://golang.org/) 进行开发实现,基于 Linux 内核的 [cgroup](https://zh.wikipedia.org/wiki/Cgroups)[namespace](https://en.wikipedia.org/wiki/Linux_namespaces),以及 [AUFS](https://en.wikipedia.org/wiki/Aufs) 类的 [Union FS](https://en.wikipedia.org/wiki/Union_mount) 等技术,对进程进行封装隔离,属于 [操作系统层面的虚拟化技术](https://en.wikipedia.org/wiki/Operating-system-level_virtualization)。由于隔离的进程独立于宿主和其它的隔离的进程,因此也称其为容器。最初实现是基于 [LXC](https://linuxcontainers.org/lxc/introduction/),从 0.7 版本以后开始去除 LXC转而使用自行开发的 [libcontainer](https://github.com/docker/libcontainer),从 1.11 开始,则进一步演进为使用 [runC](https://github.com/opencontainers/runc) 和 [containerd](https://github.com/containerd/containerd)。

View File

@ -26,7 +26,7 @@
* `apiserver` RESTful [Kubernetes API](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/api.md),供客户端和其它组件调用;
* `apiserver` RESTful [Kubernetes API](https://github.com/kubernetes/kubernetes/tree/master/docs/api-reference),供客户端和其它组件调用;
* `scheduler` pod pluggable
* `controller-manager` endpoint-controller pod replication-controller pod

View File

@ -1,5 +1,5 @@
# kubectl 使
[kubectl](https://github.com/GoogleCloudPlatform/kubernetes) 是 Kubernetes 自带的客户端,可以用它来直接操作 Kubernetes。
[kubectl](https://github.com/kubernetes/kubernetes) 是 Kubernetes 自带的客户端,可以用它来直接操作 Kubernetes。
使
```bash
@ -8,44 +8,73 @@ kubectl [command]
```
## get
Display one or many resources
## describe
Show details of a specific resource
## create
Create a resource by filename or stdin
## update
Update a resource by filename or stdin.
## delete
Delete a resource by filename, stdin, resource and ID, or by resources and label selector.
## namespace
SUPERCEDED: Set and view the current Kubernetes namespace
label selector
## log
Print the logs for a container in a pod.
pod
## rolling-update
Perform a rolling update of the given ReplicationController.
## resize
Set a new size for a Replication Controller.
replication controller
## exec
Execute a command in a container.
## port-forward
Forward one or more local ports to a pod.
Pod
## proxy
Run a proxy to the Kubernetes API server
## run-container
Run a particular image on the cluster.
## stop
Gracefully shut down a resource by id or filename.
Kubernetes API server
## run
使
## expose
Take a replicated application and expose it as Kubernetes Service
replication controller service pod kubernetes service
## label
Update the labels on a resource
label
## config
config modifies kubeconfig files
kubernetes
## cluster-info
Display cluster info
## api-versions
Print available API versions.
"组/版本" API
## version
Print the client and server version information.
## help
Help about any command

View File

@ -1,89 +1,89 @@
##
Mesos `应用` Mesos master 使
Mesos PaaS
Mesos Mesos
###
#### [Aurora](http://aurora.incubator.apache.org)
Mesos
REST webUI8081
#### [Marathon](https://github.com/mesosphere/marathon)
PaaS
bash
REST webUI8080
#### [Singularity](https://github.com/HubSpot/Singularity)
PaaS
REST webUI70998080
###
#### [Cray Chapel](https://github.com/nqn/mesos-chapel)
Chapel
#### [Dpark](https://github.com/douban/dpark)
Spark Python
#### [Hadoop](https://github.com/mesos/hadoop)
map-reduce
#### [Spark](http://spark.apache.org)
Hadoop 使
#### [Storm](https://github.com/mesos/storm)
###
#### [Chronos](https://github.com/airbnb/chronos)
Cron
#### [Jenkins](https://github.com/jenkinsci/mesos-plugin)
CI 使 mesos-jenkins jenkins Mesos
#### [JobServer](http://www.grandlogic.com/content/html_docs/jobserver.html)
Java
#### [GoDocker](https://bitbucket.org/osallou/go-docker)
Docker Mesos KubernetesSwarm
###
#### [ElasticSearch](https://github.com/mesos/elasticsearch)
APIElasticSearch + LogStash + Kibana ELK
#### [Hypertable](https://code.google.com/p/hypertable)
#### [Tachyon](http://tachyon-project.org/)
访
##
Mesos `应用` Mesos master 使
Mesos PaaS
Mesos Mesos
###
#### [Aurora](http://aurora.incubator.apache.org)
Mesos
REST webUI8081
#### [Marathon](https://github.com/mesosphere/marathon)
PaaS
bash
REST webUI8080
#### [Singularity](https://github.com/HubSpot/Singularity)
PaaS
REST webUI70998080
###
#### [Cray Chapel](https://github.com/nqn/mesos-chapel)
Chapel
#### [Dpark](https://github.com/douban/dpark)
Spark Python
#### [Hadoop](https://github.com/mesos/hadoop)
map-reduce
#### [Spark](http://spark.apache.org)
Hadoop 使
#### [Storm](https://github.com/mesos/storm)
###
#### [Chronos](https://github.com/airbnb/chronos)
Cron
#### [Jenkins](https://github.com/jenkinsci/mesos-plugin)
CI 使 mesos-jenkins jenkins Mesos
#### [JobServer](http://www.grandlogic.com/content/html_docs/jobserver.html)
Java
#### [GoDocker](https://bitbucket.org/osallou/go-docker)
Docker Mesos KubernetesSwarm
###
#### [ElasticSearch](https://github.com/mesos/elasticsearch)
APIElasticSearch + LogStash + Kibana ELK
#### [Hypertable](https://code.google.com/p/hypertable)
#### [Tachyon](http://tachyon-project.org/)
访

View File

@ -3,7 +3,7 @@ Mesos 最初由 UC Berkeley 的 AMP 实验室于 2009 年发起,遵循 Apache
Mesos + Mesos Mesosphere Datacenter Operating System (DCOS)
Mesos C++ [http://mesos.apache.org](http://mesos.apache.org),代码仍在快速演化中,已经发布了正式版 1.0.0 版本。
Mesos C++ [https://mesos.apache.org](https://mesos.apache.org),代码仍在快速演化中,已经发布了正式版 1.0.0 版本。
Mesos
* AppleTwittereBay

View File

@ -28,15 +28,13 @@ saltstack/centos-6-minimal
tutum/centos-6.4 DEPRECATED. Use tutum/centos:6.4 instead. ... 5 [OK]
```
OFFICIAL AUTOMATED
automated
`centos` Docker 使
`tianon/centos` Docker `username/` 使 tianon
`tianon/centos` Docker Hub `username/` 使 tianon
`--filter=stars=N` `N`
@ -74,24 +72,24 @@ NAME DESCRIPTION STARS
username/ubuntu
```
###
###
Automated Builds便
Automated Builds便
Docker Hub [GitHub](https://github.com) 或 [BitBucket](https://bitbucket.org))上的项目,一旦项目发生新的提交或者创建新的标签tagDocker Hub 会自动构建镜像并推送到 Docker Hub 中。
Docker Hub [GitHub](https://github.com) 或 [BitBucket](https://bitbucket.org))上的项目,一旦项目发生新的提交 commit或者创建新的标签tagDocker Hub 会自动构建镜像并推送到 Docker Hub 中。
* Docker Hub
* Docker Hub
* Docker Hub
* Docker Hub Account SettingsLinked Accounts
* Docker Hub [](https://registry.hub.docker.com/builds/add/)
* Docker Hub `Builds` `Configure Automated Builds`
* `Dockerfile`
* `Dockerfile`
* `Dockerfile`
Docker Hub [](https://registry.hub.docker.com/builds/) 中跟踪每次创建的状态。
Docker Hub `Timeline`

View File

@ -2,7 +2,7 @@
使 Docker Registry Registry Nexus `Nexus3.x` Docker 使 [`Nexus3.x`](https://www.sonatype.com/download-oss-sonatype/) 一个软件来管理 `Docker` , `Maven` , `Yum` , `PyPI` 等是一个明智的选择。
### Nexus
### Nexus
```bash
$ docker run -d --name nexus3 --restart=always \
@ -52,10 +52,10 @@ upstream register
server {
server_name YourDomainName;# DNS 使 IP 访
listen 443 ssl;
ssl_certificate key/example.crt;
ssl_certificate_key key/example.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;

View File

@ -97,20 +97,6 @@ REPOSITORY TAG IMAGE ID CREAT
Docker `HTTPS` Docker `HTTPS` 访
#### Ubuntu 14.04, Debian 7 Wheezy
使 `upstart` `/etc/default/docker` `DOCKER_OPTS`
```bash
DOCKER_OPTS="--registry-mirror=https://registry.docker-cn.com --insecure-registries=192.168.199.100:5000"
```
```bash
$ sudo service docker restart
```
#### Ubuntu 16.04+, Debian 8+, centos 7
使 `systemd` `/etc/docker/daemon.json`

View File

@ -11,5 +11,5 @@ Docker 容器和 LXC 容器很相似,所提供的安全特性也差不多。
2.6.15 2008 7
[OpenVZ](http://en.wikipedia.org/wiki/OpenVZ) 的特性。
[OpenVZ](https://en.wikipedia.org/wiki/OpenVZ) 的特性。
OpenVZ 2005

View File

@ -46,7 +46,7 @@ docker@worker1:~$ docker swarm join \
--token SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c \
192.168.99.100:2377
This node joined a swarm as a worker.
This node joined a swarm as a worker.
```
```bash
@ -58,7 +58,7 @@ docker@worker1:~$ docker swarm join \
--token SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c \
192.168.99.100:2377
This node joined a swarm as a worker.
This node joined a swarm as a worker.
```
> `docker-machine create --help` `--swarm*` `Docker Swarm`, `Swarm mode`

View File

@ -1,6 +1,6 @@
##
[cgroups](http://en.wikipedia.org/wiki/Cgroups))是 Linux 内核的一个特性,主要用来对共享资源进行隔离、限制、审计等。只有能控制分配到容器的资源,才能避免当多个容器同时运行时的对系统资源的竞争。
[cgroups](https://en.wikipedia.org/wiki/Cgroups))是 Linux 内核的一个特性,主要用来对共享资源进行隔离、限制、审计等。只有能控制分配到容器的资源,才能避免当多个容器同时运行时的对系统资源的竞争。
Google 2006 Linux 2.6.24

View File

@ -19,4 +19,4 @@ UTS("UNIX Time-sharing System") 命名空间允许每个容器拥有独立的 ho
### user
id,
* Linux [](http://blog.scottlowe.org/2013/09/04/introducing-linux-network-namespaces/)。
* Linux [](https://blog.scottlowe.org/2013/09/04/introducing-linux-network-namespaces/)。

View File

@ -1,6 +1,6 @@
##
[UnionFS](http://en.wikipedia.org/wiki/UnionFS))是一种分层、轻量级并且高性能的文件系统,它支持对文件系统的修改作为一次提交来一层层的叠加,同时可以将不同目录挂载到同一个虚拟文件系统下(unite several directories into a single virtual filesystem)。
[UnionFS](https://en.wikipedia.org/wiki/UnionFS))是一种分层、轻量级并且高性能的文件系统,它支持对文件系统的修改作为一次提交来一层层的叠加,同时可以将不同目录挂载到同一个虚拟文件系统下(unite several directories into a single virtual filesystem)。
Docker
@ -14,7 +14,7 @@ Docker 目前支持的联合文件系统包括 `OverlayFS`, `AUFS`, `Btrfs`, `VF
|Linux | Docker 使 |
| :-- | :-- |
|Docker CE on Ubuntu | `overlay2` (Ubuntu 14.04.4 +, 16.04 +) |
|Docker CE on Ubuntu | `overlay2` (16.04 +) |
|Docker CE on Debian | `overlay2` (Debian Stretch), `aufs`, `devicemapper` |
|Docker CE on CentOS | `overlay2` |
|Docker CE on Fedora | `overlay2` |