亚洲国产日韩欧美一区二区三区,精品亚洲国产成人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
文字

在聯(lián)網(wǎng)系統(tǒng)間傳輸數(shù)據(jù)時(shí),信任是一個(gè)中心問題。特別是,當(dāng)通過互聯(lián)網(wǎng)等不可信介質(zhì)進(jìn)行通信時(shí),確保系統(tǒng)運(yùn)行的所有數(shù)據(jù)的完整性和發(fā)布者至關(guān)重要。您使用Docker Engine將圖像(數(shù)據(jù))推送到公共或私有注冊表。內(nèi)容信任使您能夠通過任何通道驗(yàn)證從注冊表接收的所有數(shù)據(jù)的完整性和發(fā)布者。

理解Docker中的信任

內(nèi)容信任允許使用遠(yuǎn)程Docker注冊表執(zhí)行操作,以強(qiáng)制客戶端對圖像標(biāo)記進(jìn)行簽名和驗(yàn)證。內(nèi)容信任提供了使用數(shù)字簽名來發(fā)送和接收遠(yuǎn)程Docker注冊管理機(jī)構(gòu)數(shù)據(jù)的能力。這些簽名允許客戶端驗(yàn)證特定圖像標(biāo)簽的完整性和發(fā)布者。

目前,內(nèi)容信任被默認(rèn)禁用。要啟用它,請將DOCKER_CONTENT_TRUST環(huán)境變量設(shè)置為1。請參閱Docker客戶端的環(huán)境變量和公證配置以獲取更多選項(xiàng)。

一旦啟用內(nèi)容信任,圖像發(fā)布者就可以對其圖像進(jìn)行簽名。圖像消費(fèi)者可以確保他們使用的圖像被簽名。發(fā)布者和消費(fèi)者可以是單獨(dú)的個(gè)人或組織中的個(gè)人。Docker的內(nèi)容信任支持用戶和自動化進(jìn)程,如構(gòu)建。

圖像標(biāo)簽和內(nèi)容信任

單個(gè)圖像記錄具有以下標(biāo)識符:

[REGISTRY_HOST[:REGISTRY_PORT]/]REPOSITORY[:TAG]

一個(gè)特定的圖像REPOSITORY可以有多個(gè)標(biāo)簽。例如,latest并且3.1.2都是mongo圖像上的標(biāo)簽。圖像發(fā)布者可以在每次構(gòu)建時(shí)多次更改圖像來構(gòu)建圖像和標(biāo)簽組合。

內(nèi)容信任與TAG圖像的一部分相關(guān)聯(lián)。每個(gè)圖像庫都有一組圖像發(fā)布者用來簽署圖像標(biāo)簽的密鑰。圖片發(fā)布者可以自行決定簽署哪些標(biāo)簽。

圖像存儲庫可以包含一個(gè)圖像,其中包含一個(gè)被簽名的標(biāo)簽和另一個(gè)不是的標(biāo)簽。例如,考慮Mongo映像存儲庫。該latest標(biāo)簽可以是無簽名的,而3.1.6標(biāo)簽可以被簽名。圖片發(fā)布者有責(zé)任決定圖片標(biāo)簽是否已簽名。在這種表示中,一些圖像標(biāo)簽被簽名,而另一些則不是:

發(fā)布商可以選擇是否簽署特定標(biāo)簽。因此,未簽名標(biāo)簽的內(nèi)容與具有相同名稱的已簽名標(biāo)簽的內(nèi)容可能不匹配。例如,發(fā)布商可以推送已標(biāo)記的圖片someimage:latest并對其進(jìn)行簽名。稍后,同一個(gè)發(fā)布者可以推送未簽名的someimage:latest圖像。第二次推送替換最后一個(gè)未簽名標(biāo)簽,latest但不會影響簽名latest版本。能夠選擇他們可以簽名的標(biāo)簽,允許發(fā)布者在正式簽名之前迭代未簽名的圖像版本。

圖片使用者可以啟用內(nèi)容信任以確保他們使用的圖像已被簽名。如果消費(fèi)者啟用內(nèi)容信任,則只能使用受信任的映像進(jìn)行抽取,運(yùn)行或構(gòu)建。啟用內(nèi)容信任就像戴著一副玫瑰色的眼鏡。消費(fèi)者“see”只有簽名的圖像標(biāo)簽,不太理想的,未簽名的圖像標(biāo)簽對他們來說是“invisible”。

對于尚未啟用內(nèi)容信任的消費(fèi)者,沒有任何關(guān)于他們?nèi)绾问褂肈ocker鏡像的更改。無論是否簽名,每張圖片都可見。

內(nèi)容信任操作和密鑰

啟用內(nèi)容信任時(shí),docker對標(biāo)記圖像執(zhí)行操作的CLI命令必須具有內(nèi)容簽名或顯式內(nèi)容散列。與內(nèi)容信任一起運(yùn)行的命令是:

  • push

  • build

  • create

  • pull

  • run

例如,啟用內(nèi)容信任后,docker pull someimage:latest只有在someimage:latest簽名后才能成功。但是,只要存在散列,具有顯式內(nèi)容散列的操作就會始終成功:

$ docker pull someimage@sha256:d149ab53f8718e987c3a3024bb8aa0e2caadf6c0328f1d9d850b2a2a67f2819a

通過使用簽名密鑰來管理圖像標(biāo)簽的信任。首次調(diào)用使用內(nèi)容信任的操作時(shí)會創(chuàng)建密鑰集。密鑰集由以下幾類密鑰組成:

  • 作為圖像標(biāo)記的內(nèi)容信任的根的脫機(jī)密鑰

  • 存儲庫或標(biāo)記簽名標(biāo)簽的密鑰

  • 服務(wù)器管理的密鑰(例如時(shí)間戳密鑰),為您的存儲庫提供新鮮度安全保證

下圖描述了各種簽名密鑰及其關(guān)系:

警告:丟失根密鑰非常難以恢復(fù)。糾正這種損失需要Docker支持人員的干預(yù)來重置存儲庫狀態(tài)。這種損失還需要所有使用此存儲庫中的簽名標(biāo)記的使用者在丟失之前進(jìn)行手動干預(yù)。

您應(yīng)該將根密鑰備份到安全的地方。鑒于僅需要?jiǎng)?chuàng)建新的存儲庫,最好將其脫機(jī)存儲在硬件中。有關(guān)保護(hù)和備份密鑰的詳細(xì)信息,請務(wù)必閱讀如何管理密鑰以進(jìn)行內(nèi)容信任。

典型內(nèi)容信任操作調(diào)查

本節(jié)將調(diào)查用戶使用Docker鏡像執(zhí)行的典型可信操作。具體來說,我們將通過以下步驟來幫助我們實(shí)施以下各種可信操作:

  • 構(gòu)建并推送未簽名的圖像

  • 拉一個(gè)未簽名的圖像

  • 構(gòu)建并推送簽名圖像

  • 拉上面推送的簽名圖像

  • 拉出上面推送的無符號圖像

啟用和禁用每個(gè)shell或每次調(diào)用的內(nèi)容信任

在shell中,可以通過設(shè)置DOCKER_CONTENT_TRUST環(huán)境變量來啟用內(nèi)容信任。啟用per-shell非常有用,因?yàn)槟梢詾榭尚挪僮髋渲靡粋€(gè)shell,為不可信操作配置另一個(gè)終端shell。您還可以將此聲明添加到您的shell配置文件中,以便默認(rèn)情況下始終打開它。

若要在bashshell輸入以下命令:

export DOCKER_CONTENT_TRUST=1

一旦設(shè)置,每個(gè)“tag”操作都需要一個(gè)可信標(biāo)簽的密鑰。

DOCKER_CONTENT_TRUST設(shè)置的環(huán)境中,您可以使用此--disable-content-trust標(biāo)志按需在不帶內(nèi)容信任的情況下對標(biāo)記圖像運(yùn)行單個(gè)操作。

考慮使用不受信任父映像的以下Dockerfile:

$  cat Dockerfile
FROM docker/trusttest:latest
RUN echo

為了使用這個(gè)Dockerfile成功構(gòu)建一個(gè)容器,可以這樣做:

$  docker build --disable-content-trust -t <username>/nottrusttest:latest .Sending build context to Docker daemon 42.84 MB...Successfully built f21b872447dc

所有其他命令也是如此,例如pullpush

$  docker pull --disable-content-trust docker/trusttest:latest...$  docker push --disable-content-trust <username>/nottrusttest:latest...

無論是否DOCKER_CONTENT_TRUST設(shè)置變量或如何設(shè)置,都要啟用啟用內(nèi)容信任的命令:

$  docker build --disable-content-trust=false -t <username>/trusttest:testing .

所有受信任的操作都支持該--disable-content-trust標(biāo)志。

推送可信內(nèi)容

要為特定圖像標(biāo)記創(chuàng)建簽名內(nèi)容,只需啟用內(nèi)容信任并推送標(biāo)記的圖像即可。如果這是您第一次在系統(tǒng)上使用內(nèi)容信任推送圖像,則會話如下所示:

$ docker push <username>/trusttest:testing
The push refers to a repository [docker.io/<username>/trusttest] (len: 1)9a61b6b1315e: Image already exists
902b87aaaec9: Image already exists
latest: digest: sha256:d02adacee0ac7a5be140adb94fa1dae64f4e71a68696e7f8e7cbf9db8dd49418 size: 3220Signing and pushing trust metadata
You are about to create a new root signing key passphrase. This passphrase
will be used to protect the most sensitive key in your signing system. Please
choose a long, complex passphrase and be careful to keep the password and the
key file itself secure and backed up. It is highly recommended that you use a
password manager to generate the passphrase and keep it safe. There will be no
way to recover this key. You can find the key in your config directory.Enter passphrase for new root key with id a1d96fb:Repeat passphrase for new root key with id a1d96fb:Enter passphrase for new repository key with id docker.io/<username>/trusttest (3a932f1):Repeat passphrase for new repository key with id docker.io/<username>/trusttest (3a932f1):Finished initializing "docker.io/<username>/trusttest"

當(dāng)您啟用啟用內(nèi)容信任的第一個(gè)標(biāo)記圖像時(shí),docker客戶端會認(rèn)識到這是您的第一次推送,并且:

  • 提醒您它將創(chuàng)建一個(gè)新的根密鑰

  • 請求根密鑰的密碼

  • ~/.docker/trust目錄中生成一個(gè)根密鑰

  • 請求存儲庫密鑰的密碼

  • ~/.docker/trust目錄中生成一個(gè)存儲庫密鑰

您為根密鑰和存儲庫密鑰對選擇的密碼應(yīng)隨機(jī)生成并存儲在密碼管理器中

注意:如果您省略testing標(biāo)簽,則跳過內(nèi)容信任。即使啟用了內(nèi)容信任,即使這是您的第一次推送,情況也是如此。

$ docker push <username>/trusttest
The push refers to a repository [docker.io/<username>/trusttest] (len: 1)9a61b6b1315e: Image successfully pushed
902b87aaaec9: Image successfully pushed
latest: digest: sha256:a9a9c4402604b703bed1c847f6d85faac97686e48c579bd9c3b0fa6694a398fc size: 3220No tag specified, skipping trust metadata push

它被跳過,因?yàn)橄⒅赋?,你沒有提供圖像TAG值。在Docker內(nèi)容信任中,簽名與標(biāo)簽相關(guān)聯(lián)。

一旦在系統(tǒng)上擁有root密鑰,您創(chuàng)建的后續(xù)圖像存儲庫就可以使用相同的根密鑰:

$ docker push docker.io/<username>/otherimage:latest
The push refers to a repository [docker.io/<username>/otherimage] (len: 1)a9539b34a6ab: Image successfully pushed
b3dbab3810fc: Image successfully pushed
latest: digest: sha256:d2ba1e603661a59940bfad7072eba698b79a8b20ccbb4e3bfb6f9e367ea43939 size: 3346Signing and pushing trust metadata
Enter key passphrase for root key with id a1d96fb:Enter passphrase for new repository key with id docker.io/<username>/otherimage (bb045e3):Repeat passphrase for new repository key with id docker.io/<username>/otherimage (bb045e3):Finished initializing "docker.io/<username>/otherimage"

新圖像具有自己的存儲庫密鑰和時(shí)間戳密鑰。該latest標(biāo)簽與這兩個(gè)簽名。

提取圖片內(nèi)容

消費(fèi)圖像的常用方式就是pull它。啟用內(nèi)容信任后,Docker客戶端僅允許docker pull檢索已簽名的圖像。讓我們試著拉你之前簽名和推送的圖片:

$  docker pull <username>/trusttest:testingPull (1 of 1): <username>/trusttest:testing@sha256:d149ab53f871...Tagging <username>/trusttest@sha256:d149ab53f871 as docker/trusttest:testing

在以下示例中,該命令沒有指定標(biāo)簽,因此系統(tǒng)latest默認(rèn)再次使用該標(biāo)簽,并且該docker/trusttest:latest標(biāo)簽未被簽名。

$ docker pull docker/trusttest
Using default tag: latest
no trust data available

由于標(biāo)記docker/trusttest:latest不可信,因此pull失敗。

相關(guān)信息

  • 管理內(nèi)容信任的密鑰

  • 內(nèi)容信任的自動化

  • 內(nèi)容信任代表團(tuán)

  • 在內(nèi)容信任沙箱中播放

上一篇: 下一篇: