亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

directory search
Compose About versions and upgrading (Compose) ASP.NET Core + SQL Server on Linux (Compose) CLI environment variables (Compose) Command-line completion (Compose) Compose(組成) Compose command-line reference(組合命令行參考) Control startup order (Compose) Django and PostgreSQL (Compose) Docker stacks and distributed application bundles (Compose) docker-compose build(docker-compose構(gòu)建) docker-compose bundle docker-compose config docker-compose create docker-compose down docker-compose events docker-compose exec docker-compose help docker-compose images docker-compose kill docker-compose logs docker-compose pause docker-compose port docker-compose ps docker-compose pull docker-compose push docker-compose restart docker-compose rm docker-compose run docker-compose scale docker-compose start docker-compose stop docker-compose top docker-compose unpause docker-compose up Environment file (Compose) Environment variables in Compose Extend services in Compose Frequently asked questions (Compose) Getting started (Compose) Install Compose Link environment variables (deprecated) (Compose) Networking in Compose Overview of Docker Compose Overview of docker-compose CLI Quickstart: Compose and WordPress Rails and PostgreSQL (Compose) Sample apps with Compose Using Compose in production Using Compose with Swarm Engine .NET Core application (Engine) About images, containers, and storage drivers (Engine) Add nodes to the swarm (Engine) Apply custom metadata (Engine) Apply rolling updates (Engine) apt-cacher-ng Best practices for writing Dockerfiles (Engine) Binaries (Engine) Bind container ports to the host (Engine) Breaking changes (Engine) Build your own bridge (Engine) Configure container DNS (Engine) Configure container DNS in user-defined networks (Engine) CouchDB (Engine) Create a base image (Engine) Create a swarm (Engine) Customize the docker0 bridge (Engine) Debian (Engine) Default bridge network Delete the service (Engine) Deploy a service (Engine) Deploy services to a swarm (Engine) Deprecated Engine features Docker container networking (Engine) Docker overview (Engine) Docker run reference (Engine) Dockerfile reference (Engine) Dockerize an application Drain a node (Engine) Engine FAQ (Engine) Fedora (Engine) Get started (Engine) Get started with macvlan network driver (Engine) Get started with multi-host networking (Engine) How nodes work (Engine) How services work (Engine) Image management (Engine) Inspect the service (Engine) Install Docker (Engine) IPv6 with Docker (Engine) Join nodes to a swarm (Engine) Legacy container links (Engine) Lock your swarm (Engine) Manage nodes in a swarm (Engine) Manage sensitive data with Docker secrets (Engine) Manage swarm security with PKI (Engine) Manage swarm service networks (Engine) Migrate to Engine 1.10 Optional Linux post-installation steps (Engine) Overview (Engine) PostgreSQL (Engine) Raft consensus in swarm mode (Engine) Riak (Engine) Run Docker Engine in swarm mode Scale the service (Engine) SDKs (Engine) Select a storage driver (Engine) Set up for the tutorial (Engine) SSHd (Engine) Storage driver overview (Engine) Store service configuration data (Engine) Swarm administration guide (Engine) Swarm mode key concepts (Engine) Swarm mode overlay network security model (Engine) Swarm mode overview (Engine) Understand container communication (Engine) Use multi-stage builds (Engine) Use swarm mode routing mesh (Engine) Use the AUFS storage driver (Engine) Use the Btrfs storage driver (Engine) Use the Device mapper storage driver (Engine) Use the OverlayFS storage driver (Engine) Use the VFS storage driver (Engine) Use the ZFS storage driver (Engine) Engine: Admin Guide Amazon CloudWatch logs logging driver (Engine) Bind mounts (Engine) Collect Docker metrics with Prometheus (Engine) Configuring and running Docker (Engine) Configuring logging drivers (Engine) Control and configure Docker with systemd (Engine) ETW logging driver (Engine) Fluentd logging driver (Engine) Format command and log output (Engine) Google Cloud logging driver (Engine) Graylog Extended Format (GELF) logging driver (Engine) Journald logging driver (Engine) JSON File logging driver (Engine) Keep containers alive during daemon downtime (Engine) Limit a container's resources (Engine) Link via an ambassador container (Engine) Log tags for logging driver (Engine) Logentries logging driver (Engine) PowerShell DSC usage (Engine) Prune unused Docker objects (Engine) Run multiple services in a container (Engine) Runtime metrics (Engine) Splunk logging driver (Engine) Start containers automatically (Engine) Storage overview (Engine) Syslog logging driver (Engine) tmpfs mounts Troubleshoot volume problems (Engine) Use a logging driver plugin (Engine) Using Ansible (Engine) Using Chef (Engine) Using Puppet (Engine) View a container's logs (Engine) Volumes (Engine) Engine: CLI Daemon CLI reference (dockerd) (Engine) docker docker attach docker build docker checkpoint docker checkpoint create docker checkpoint ls docker checkpoint rm docker commit docker config docker config create docker config inspect docker config ls docker config rm docker container docker container attach docker container commit docker container cp docker container create docker container diff docker container exec docker container export docker container inspect docker container kill docker container logs docker container ls docker container pause docker container port docker container prune docker container rename docker container restart docker container rm docker container run docker container start docker container stats docker container stop docker container top docker container unpause docker container update docker container wait docker cp docker create docker deploy docker diff docker events docker exec docker export docker history docker image docker image build docker image history docker image import docker image inspect docker image load docker image ls docker image prune docker image pull docker image push docker image rm docker image save docker image tag docker images docker import docker info docker inspect docker kill docker load docker login docker logout docker logs docker network docker network connect docker network create docker network disconnect docker network inspect docker network ls docker network prune docker network rm docker node docker node demote docker node inspect docker node ls docker node promote docker node ps docker node rm docker node update docker pause docker plugin docker plugin create docker plugin disable docker plugin enable docker plugin inspect docker plugin install docker plugin ls docker plugin push docker plugin rm docker plugin set docker plugin upgrade docker port docker ps docker pull docker push docker rename docker restart docker rm docker rmi docker run docker save docker search docker secret docker secret create docker secret inspect docker secret ls docker secret rm docker service docker service create docker service inspect docker service logs docker service ls docker service ps docker service rm docker service scale docker service update docker stack docker stack deploy docker stack ls docker stack ps docker stack rm docker stack services docker start docker stats docker stop docker swarm docker swarm ca docker swarm init docker swarm join docker swarm join-token docker swarm leave docker swarm unlock docker swarm unlock-key docker swarm update docker system docker system df docker system events docker system info docker system prune docker tag docker top docker unpause docker update docker version docker volume docker volume create docker volume inspect docker volume ls docker volume prune docker volume rm docker wait Use the Docker command line (Engine) Engine: Extend Access authorization plugin (Engine) Docker log driver plugins Docker network driver plugins (Engine) Extending Engine with plugins Managed plugin system (Engine) Plugin configuration (Engine) Plugins API (Engine) Volume plugins (Engine) Engine: Security AppArmor security profiles for Docker (Engine) Automation with content trust (Engine) Content trust in Docker (Engine) Delegations for content trust (Engine) Deploying Notary (Engine) Docker security (Engine) Docker security non-events (Engine) Isolate containers with a user namespace (Engine) Manage keys for content trust (Engine) Play in a content trust sandbox (Engine) Protect the Docker daemon socket (Engine) Seccomp security profiles for Docker (Engine) Secure Engine Use trusted images Using certificates for repository client verification (Engine) Engine: Tutorials Engine tutorials Network containers (Engine) Get Started Part 1: Orientation Part 2: Containers Part 3: Services Part 4: Swarms Part 5: Stacks Part 6: Deploy your app Machine Amazon Web Services (Machine) Digital Ocean (Machine) docker-machine active docker-machine config docker-machine create docker-machine env docker-machine help docker-machine inspect docker-machine ip docker-machine kill docker-machine ls docker-machine provision docker-machine regenerate-certs docker-machine restart docker-machine rm docker-machine scp docker-machine ssh docker-machine start docker-machine status docker-machine stop docker-machine upgrade docker-machine url Driver options and operating system defaults (Machine) Drivers overview (Machine) Exoscale (Machine) Generic (Machine) Get started with a local VM (Machine) Google Compute Engine (Machine) IBM Softlayer (Machine) Install Machine Machine Machine CLI overview Machine command-line completion Machine concepts and help Machine overview Microsoft Azure (Machine) Microsoft Hyper-V (Machine) Migrate from Boot2Docker to Machine OpenStack (Machine) Oracle VirtualBox (Machine) Provision AWS EC2 instances (Machine) Provision Digital Ocean Droplets (Machine) Provision hosts in the cloud (Machine) Rackspace (Machine) VMware Fusion (Machine) VMware vCloud Air (Machine) VMware vSphere (Machine) Notary Client configuration (Notary) Common Server and signer configurations (Notary) Getting started with Notary Notary changelog Notary configuration files Running a Notary service Server configuration (Notary) Signer configuration (Notary) Understand the service architecture (Notary) Use the Notary client
characters

AUFS 聯(lián)合文件系統(tǒng)。的aufs存儲(chǔ)驅(qū)動(dòng)程序是用于在多克爾管理圖像和層的Ubuntu的默認(rèn)存儲(chǔ)驅(qū)動(dòng)器,以及適用于Debian版本拉伸之前。對(duì)于Debian Stretch,overlay2是默認(rèn)值。

AUFS是Docker使用的最成熟的存儲(chǔ)驅(qū)動(dòng)程序。它提供了快速的容器啟動(dòng)時(shí)間,以及高效的內(nèi)存和存儲(chǔ)使用。

如果您的Linux內(nèi)核版本為4.0或更高版本,并且您使用Docker CE,請(qǐng)考慮使用較新的overlay2,它比aufs存儲(chǔ)驅(qū)動(dòng)程序具有潛在的性能優(yōu)勢(shì)。

注意:盡管如果AUFS在Linux內(nèi)核中存在,但默認(rèn)情況下使用AUFS,但某些分發(fā)版和Docker版本不支持AUFS。請(qǐng)參閱先決條件>以獲取有關(guān)受支持平臺(tái)的更多信息,另請(qǐng)參閱存儲(chǔ)驅(qū)動(dòng)程序首選項(xiàng)的順序。

先決條件

  • 對(duì)于Docker CE,AUFS在Ubuntu上支持,而在Stretch之前在Debian版本上支持。

  • 對(duì)于Docker EE,AUFS在Ubuntu上受支持。

  • 如果您使用Ubuntu,則需要安裝額外的軟件包以將AUFS模塊添加到內(nèi)核。如果您不安裝這些軟件包,則需要devicemapper在Ubuntu 14.04(不推薦)或overlay2Ubuntu 16.04及更高版本上使用,這也受支持。

  • AUFS不能使用下面的后盾文件系統(tǒng):aufs,btrfs,或ecryptfs。這意味著包含的文件系統(tǒng)/var/lib/docker/aufs不能是這些文件系統(tǒng)類型之一。

使用aufs存儲(chǔ)驅(qū)動(dòng)程序配置Docker

如果在啟動(dòng)Docker時(shí)將AUFS驅(qū)動(dòng)程序加載到內(nèi)核中,并且沒有配置其他存儲(chǔ)驅(qū)動(dòng)程序,Docker默認(rèn)使用它。

  1. 使用以下命令來驗(yàn)證您的內(nèi)核是否支持AUFS。$ grep aufs /proc/filesystems  nodev   aufs

  2. 檢查Docker正在使用哪個(gè)存儲(chǔ)驅(qū)動(dòng)程序。$ docker info <truncated output>存儲(chǔ)驅(qū)動(dòng)程序:aufs  Root Dir: /var/lib/docker/aufs 備份文件系統(tǒng):extfs Dirs:0 Dirperm1支持:true<truncated output>

  3. 如果您使用的是不同的存儲(chǔ)驅(qū)動(dòng)程序,則AUFS不包含在內(nèi)核中(在這種情況下,將使用不同的默認(rèn)驅(qū)動(dòng)程序),或者Docker已明確配置為使用不同的驅(qū)動(dòng)程序。檢查/etc/docker/daemon.json或輸出ps auxw | grep dockerd以查看Docker是否已經(jīng)啟動(dòng)了--storage-driver標(biāo)志。

如何aufs存儲(chǔ)驅(qū)動(dòng)程序作品

AUFS是一個(gè)聯(lián)合文件系統(tǒng),這意味著它在單個(gè)Linux主機(jī)上分層多個(gè)目錄并將它們呈現(xiàn)為單個(gè)目錄。這些目錄在AUFS術(shù)語中稱為分支,在Docker術(shù)語中稱為。統(tǒng)一過程被稱為聯(lián)合安裝。

下圖顯示了一個(gè)基于ubuntu:latest圖像的Docker容器。



每個(gè)圖像層和容器層都在Docker主機(jī)上表示為子目錄/var/lib/docker/。聯(lián)合安裝提供了所有圖層的統(tǒng)一視圖。目錄名稱不直接對(duì)應(yīng)于圖層本身的ID。

AUFS使用Copy-on-Write(CoW)策略來最大限度地提高存儲(chǔ)效率并將開銷降至最低。

示例:映像和容器在磁盤上的結(jié)構(gòu)

以下docker pull命令顯示了一個(gè)Docker主機(jī)下載一個(gè)包含五層的Docker鏡像。

$ docker pull ubuntu

Using default tag: latest
latest: Pulling from library/ubuntu
b6f892c0043b: Pull complete
55010f332b04: Pull complete
2955fb827c94: Pull complete
3deef3fcbd30: Pull complete
cf9722e506aa: Pull complete
Digest: sha256:382452f82a8bbd34443b2c727650af46aced0f94a44463c62a9848133ecb1aa8
Status: Downloaded newer image for ubuntu:latest

圖像層

警告:不要直接操作其中的任何文件或目錄/var/lib/docker/。這些文件和目錄由Docker管理。

所有關(guān)于圖像和容器圖層的信息都存儲(chǔ)在中的子目錄中/var/lib/docker/aufs/

  • diff/:每個(gè)圖層的內(nèi)容,每個(gè)圖層都存儲(chǔ)在一個(gè)單獨(dú)的子目錄中

  • layers/:關(guān)于圖像圖層堆疊的元數(shù)據(jù)。該目錄包含Docker主機(jī)上每個(gè)圖像或容器層的一個(gè)文件。每個(gè)文件都包含堆棧(其父項(xiàng))下面的所有圖層的ID。

  • mnt/:安裝點(diǎn),每個(gè)映像或容器層一個(gè),用于組裝和安裝容器的統(tǒng)一文件系統(tǒng)。對(duì)于只讀的圖像,這些目錄將始終為空。

容器層

如果容器正在運(yùn)行,則以/var/lib/docker/aufs/下列方式更改內(nèi)容:

  • diff/:可寫容器層中引入的差異,如新文件或修改過的文件。

  • layers/:關(guān)于可寫容器層的父層的元數(shù)據(jù)。

  • mnt/:每個(gè)正在運(yùn)行的容器的統(tǒng)一文件系統(tǒng)的安裝點(diǎn),完全與容器內(nèi)顯示的一樣。

容器用aufs讀取和寫入的工作方式

讀取文件

考慮三種場景,其中一個(gè)容器打開一個(gè)文件進(jìn)行重疊讀取訪問。

  • 該文件不存在于容器層中:如果容器打開一個(gè)文件以進(jìn)行讀取訪問,并且文件尚不存在于容器層中,則存儲(chǔ)驅(qū)動(dòng)程序會(huì)在圖像層中搜索文件,容器層。它從它所在的圖層讀取。

  • 該文件僅存在于容器層中:如果容器打開一個(gè)用于讀取訪問的文件,并且文件存在于容器層中,則從該文件中讀取該文件。

  • 該文件同時(shí)存在于容器圖層和圖像圖層中:如果容器打開文件進(jìn)行讀取訪問,并且文件存在于容器圖層和一個(gè)或多個(gè)圖像圖層中,則從容器圖層讀取文件。容器圖層中的文件會(huì)隱藏圖像圖層中具有相同名稱的文件。

修改文件或目錄

考慮一些容器中的文件被修改的場景。

  • 第一次寫入文件:容器首次寫入現(xiàn)有文件時(shí),該文件不存在于容器(upperdir)中。該aufs驅(qū)動(dòng)程序執(zhí)行copy_up操作將文件從存在的圖像層復(fù)制到可寫容器層。容器然后將更改寫入容器層中的文件的新副本。但是,AUFS在文件級(jí)別而不是塊級(jí)別上工作。這意味著所有的copy_up操作都會(huì)復(fù)制整個(gè)文件,即使文件非常大,只有一小部分被修改。這可能會(huì)對(duì)容器寫入性能產(chǎn)生顯著影響。AUFS在搜索多層圖像中的文件時(shí)可能會(huì)出現(xiàn)明顯的延遲。但是,值得注意的是copy_up操作僅在給定文件第一次寫入時(shí)發(fā)生。隨后寫入同一文件的操作與已經(jīng)復(fù)制到容器的文件副本相反。

  • 刪除文件和目錄

-  When a _file_ is deleted within a container, a _whiteout_ file is created in the container layer. The version of the file in the image layer is not deleted (because the image layers are read-only). However, the whiteout file prevents it from being available to the container.
-  When a _directory_ is deleted within a container, an _opaque file_ is created in the container layer. This works in the same way as a whiteout file and effectively prevents the directory from being accessed, even though it still exists in the image layer.
  • 重命名目錄rename(2)在AUFS上不完全支持呼叫目錄。它返回EXDEV(即“跨設(shè)備鏈接不允許”),即使源和目標(biāo)路徑都位于同一個(gè)AUFS層上,除非目錄中沒有子節(jié)點(diǎn)。您的應(yīng)用程序需要被設(shè)計(jì)為處理EXDEV并回退到“復(fù)制和取消鏈接”策略。

AUFS和Docker性能

總結(jié)一些已經(jīng)提到的性能相關(guān)方面:

  • AUFS存儲(chǔ)驅(qū)動(dòng)程序的性能低于overlay2驅(qū)動(dòng)程序,但對(duì)于PaaS和其他類似的容器密度很重要的使用案例來說,這是一個(gè)不錯(cuò)的選擇。這是因?yàn)锳UFS可以在多個(gè)正在運(yùn)行的容器之間高效地共享映像,從而實(shí)現(xiàn)快速的容器啟動(dòng)時(shí)間和最少的磁盤空間使用。

  • AUFS如何在圖像層和容器之間共享文件的底層機(jī)制非常高效地使用頁面緩存。

  • AUFS存儲(chǔ)驅(qū)動(dòng)程序可以在容器寫入性能方面引入顯著的延遲。這是因?yàn)榈谝淮稳萜鲗懭肴魏挝募r(shí),該文件必須被定位并被復(fù)制到容器頂部可寫層中。當(dāng)這些文件存在于許多圖像層下并且文件本身很大時(shí),這些延遲會(huì)增加并且復(fù)雜化。

性能最佳實(shí)踐

以下通用性能最佳實(shí)踐也適用于AUFS。

  • 固態(tài)設(shè)備(SSD)比旋轉(zhuǎn)磁盤提供更快的讀取和寫入速度。

  • 將卷用于寫入繁重的工作負(fù)載:卷為寫入繁重的工作負(fù)載提供最佳和最可預(yù)測的性能。這是因?yàn)樗鼈兝@過了存儲(chǔ)驅(qū)動(dòng)程序,并且不會(huì)產(chǎn)生精簡配置和寫入時(shí)復(fù)制引入的任何潛在開銷。卷還有其他好處,例如允許您在容器之間共享數(shù)據(jù),并且即使在沒有正在運(yùn)行的容器正在使用它們時(shí)也會(huì)持久存在。

相關(guān)信息

  • 了解圖像,容器和存儲(chǔ)驅(qū)動(dòng)程序

  • 選擇存儲(chǔ)驅(qū)動(dòng)程序

  • Btrfs存儲(chǔ)驅(qū)動(dòng)程序在實(shí)踐中

  • Device Mapper存儲(chǔ)驅(qū)動(dòng)程序在實(shí)踐中

Previous article: Next article: