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

目錄 搜尋
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
文字

注意:您可能已被重定向到此頁(yè)面,因?yàn)槟?Linux 發(fā)行版不再有動(dòng)態(tài)鏈接的 Docker 軟件包。

如果你想嘗試 Docker 或者在測(cè)試環(huán)境中使用它,但你不在受支持的平臺(tái)上,你可以嘗試從靜態(tài)二進(jìn)制文件安裝。如果可能,應(yīng)該使用為您的操作系統(tǒng)構(gòu)建的軟件包,并使用操作系統(tǒng)的軟件包管理系統(tǒng)來(lái)管理 Docker 安裝和升級(jí)。請(qǐng)注意,32位靜態(tài)二進(jìn)制歸檔文件不包含 Docker 守護(hù)進(jìn)程(daemon)。

Docker 守護(hù)進(jìn)程(daemon)二進(jìn)制文件的靜態(tài)二進(jìn)制文件僅適用于 Linux(as dockerd)和 Windows Server 2016 或 Windows 10(as dockerd.exe)。Docker 客戶端的靜態(tài)二進(jìn)制文件可用于 Linux 和 MacOS(as docker)以及 Windows Server 2016或 Windows 10(as docker.exe)。

在 Linux 上安裝守護(hù)進(jìn)程和客戶端二進(jìn)制文件

先決條件

本文檔涵蓋Docker公司和Docker社區(qū)推薦的最佳做法和方法,以創(chuàng)建易于使用、有效的產(chǎn)品。Dockerfile我們強(qiáng)烈建議您遵循這些建議%28事實(shí)上,如果您正在創(chuàng)建一個(gè)官方形象,您堅(jiān)持這些實(shí)踐%29。

  • 64位安裝

注意:有關(guān)此處提到的任何Dockerfile命令的更詳細(xì)說(shuō)明,請(qǐng)?jiān)L問(wèn)Dockerfile引用一頁(yè)。

  • iptables 版本1.4或更高

  • git 版本1.7或更高版本

由圖像生成的容器Dockerfile定義應(yīng)該盡可能的短暫。所謂“短暫”,我們的意思是,它可以被停止和摧毀,一個(gè)新的建立和安置的絕對(duì)最小的設(shè)置和配置。您可能想看看過(guò)程12要素應(yīng)用程序方法中的一節(jié),以了解以這樣一種無(wú)狀態(tài)方式運(yùn)行容器的動(dòng)機(jī)。

  • XZ Utils  4.9或更高版本

在大多數(shù)情況下,最好將每個(gè)Dockerfile放在一個(gè)空目錄中。然后,只向該目錄添加構(gòu)建Dockerfile所需的文件。若要提高生成的性能,可以通過(guò)添加.dockerignore文件也放在那個(gè)目錄下。此文件支持類似于.gitignore檔案。有關(guān)創(chuàng)建一個(gè)的信息,請(qǐng)參見.dockerignore文件...

避免安裝不必要的軟件包

為了減少?gòu)?fù)雜性、依賴性、文件大小和構(gòu)建時(shí)間,您應(yīng)該避免僅僅因?yàn)椤皳碛小鳖~外的或不必要的包而安裝它們。例如,不需要在數(shù)據(jù)庫(kù)映像中包含文本編輯器。

每個(gè)容器應(yīng)該只關(guān)心一個(gè)問(wèn)題。

將應(yīng)用程序解耦到多個(gè)容器中,可以更容易地進(jìn)行水平擴(kuò)展和重用容器。例如,Web應(yīng)用程序堆??赡苡扇齻€(gè)單獨(dú)的容器組成,每個(gè)容器都有自己獨(dú)特的映像,以解耦的方式管理Web應(yīng)用程序、數(shù)據(jù)庫(kù)和內(nèi)存中的緩存。

您可能聽說(shuō)過(guò)“每個(gè)容器應(yīng)該有一個(gè)過(guò)程”。雖然這個(gè)咒語(yǔ)有良好的意圖,但不一定每個(gè)容器只應(yīng)該有一個(gè)操作系統(tǒng)進(jìn)程。除了容器現(xiàn)在可以由init進(jìn)程生成,一些程序可能會(huì)自動(dòng)產(chǎn)生額外的進(jìn)程。例如,芹菜可以生成多個(gè)工作進(jìn)程,或阿帕奇可能會(huì)為每個(gè)請(qǐng)求創(chuàng)建一個(gè)進(jìn)程。雖然“每個(gè)容器一個(gè)進(jìn)程”通常是一個(gè)好的經(jīng)驗(yàn)法則,但它并不是一個(gè)硬和快速的規(guī)則。用你最好的判斷來(lái)保持容器盡可能的干凈和模塊化。

如果容器相互依賴,則可以使用碼頭集裝箱網(wǎng)絡(luò)以確保這些容器能夠通信。

盡量減少層數(shù)

您需要找到可讀性(以及長(zhǎng)期可維護(hù)性)Dockerfile與最小化其使用的層數(shù)之間的平衡。對(duì)您使用的圖層數(shù)量保持戰(zhàn)略性和謹(jǐn)慎。

排序多行參數(shù)

只要有可能,可以通過(guò)對(duì)多行參數(shù)進(jìn)行字母數(shù)字排序來(lái)簡(jiǎn)化以后的更改。這將幫助您避免包的重復(fù),并使列表更容易更新。這也使PRs更容易閱讀和審查。在反斜杠%28之前添加空格\%29也有幫助。

下面是一個(gè)來(lái)自buildpack-deps圖像*

RUN apt-get update && apt-get install -y \
  bzr \
  cvs \
  git \
  mercurial \
  subversion

構(gòu)建緩存

在構(gòu)建圖像碼頭的過(guò)程中,您將逐步了解Dockerfile按照指定的順序執(zhí)行每個(gè)。在檢查每條指令時(shí),Docker將在其緩存中尋找一個(gè)可以重用的現(xiàn)有映像,而不是創(chuàng)建一個(gè)新的%28重復(fù)%29映像。如果您根本不想使用緩存,則可以使用--no-cache=true選項(xiàng)的docker build命令。

但是,如果您確實(shí)讓Docker使用它的緩存,那么非常重要的是要了解它什么時(shí)候會(huì),并且不會(huì)找到匹配的映像。碼頭工人將遵循的基本規(guī)則概述如下:

  • 從緩存中已經(jīng)存在的父映像開始,將下一條指令與從該基本映像派生的所有子映像進(jìn)行比較,以查看其中一個(gè)是使用完全相同的指令生成的。否則,緩存將失效。

  • 在大多數(shù)情況下,只需比較Dockerfile其中一個(gè)孩子的圖像就足夠了。然而,某些指示需要更多的檢查和解釋。

  • ADDCOPY說(shuō)明,檢查圖像中文件%28s%29的內(nèi)容,并計(jì)算每個(gè)文件的校驗(yàn)和。在這些校驗(yàn)和中不考慮文件%28s%29的最后修改和最后訪問(wèn)次數(shù)。在緩存查找過(guò)程中,將校驗(yàn)和與現(xiàn)有圖像中的校驗(yàn)和進(jìn)行比較。如果文件%28s%29中有任何更改,如內(nèi)容和元數(shù)據(jù),則緩存無(wú)效。

  • 除了ADDCOPY命令時(shí),緩存檢查將不會(huì)查看容器中的文件以確定緩存匹配。例如,當(dāng)處理RUN apt-get -y update命令不會(huì)檢查容器中更新的文件以確定是否存在緩存命中。在這種情況下,僅使用命令字符串本身來(lái)查找匹配項(xiàng)。

一旦緩存失效,所有后續(xù)Dockerfile命令將生成新圖像,緩存將不被使用。

Dockerfile指令

下面,您將找到關(guān)于編寫各種可用說(shuō)明的最佳方法的建議,以便在Dockerfile...

FROM指令的Dockerfile引用

只要有可能,使用當(dāng)前的官方存儲(chǔ)庫(kù)作為你形象的基礎(chǔ)。我們推薦Debian圖像因?yàn)樗欠浅?yán)格控制和保持最小的%28目前低于150 MB%29,同時(shí)仍然是一個(gè)完整的發(fā)行版。

標(biāo)簽

理解對(duì)象標(biāo)簽

您可以向圖像中添加標(biāo)簽,以幫助按項(xiàng)目組織圖像、記錄許可信息、幫助自動(dòng)化或其他原因。對(duì)于每個(gè)標(biāo)簽,添加一行以LABEL和一個(gè)或多個(gè)鍵值對(duì)。下面的示例顯示了不同的可接受格式。解釋性評(píng)論包括內(nèi)聯(lián)。

*如果字符串包含空格,則必須引用它這些空間必須逃掉。如果字符串包含內(nèi)部引號(hào)字符%28"%29,也要逃離他們。

# Set one or more individual labels
LABEL com.example.version="0.0.1-beta"LABEL vendor="ACME Incorporated"LABEL com.example.release-date="2015-02-12"LABEL com.example.version.is-production=""# Set multiple labels on one line
LABEL com.example.version="0.0.1-beta" com.example.release-date="2015-02-12"# Set multiple labels at once, using line-continuation characters to break long lines
LABEL vendor=ACME\ Incorporated \
      com.example.is-beta= \
      com.example.is-production="" \
      com.example.version="0.0.1-beta" \
      com.example.release-date="2015-02-12"

見理解對(duì)象標(biāo)簽有關(guān)可接受的標(biāo)簽鍵和值的指南。有關(guān)查詢標(biāo)簽的信息,請(qǐng)參考與管理對(duì)象的標(biāo)簽...

運(yùn)行指令的Dockerfile引用

一如既往,讓你Dockerfile更易讀,更易理解,更易維護(hù),分裂更長(zhǎng)或更復(fù)雜RUN語(yǔ)句在用反斜杠分隔的多行上。

上一篇: 下一篇: