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

Docker 引擎管理的插件系統(tǒng)

  • 安裝和使用插件

  • 開發(fā)一個插件

  • 調(diào)試插件

Docker Engine 的插件系統(tǒng)允許您使用 Docker Engine 安裝,啟動,停止和移除插件。

有關(guān) Docker Engine 1.12及更早版本中提供的傳統(tǒng)插件系統(tǒng)的信息,請參閱了解傳統(tǒng) Docker 引擎插件。

注意:Windows 守護程序目前不支持 Docker Engine 托管插件。

安裝和使用插件

插件以 Docker 鏡像的形式發(fā)布,可以托管在 Docker Hub 或私有注冊表中。

要安裝插件,請使用docker plugin install從 Docker Hub 或您的私人注冊表中提取插件的命令,并在必要時提示您授予權(quán)限或功能,并啟用該插件。

要檢查已安裝插件的狀態(tài),請使用該docker plugin ls命令。成功啟動的插件在輸出中列為啟用。

在安裝插件之后,您可以將其用作另一個 Docker 操作的選項,例如創(chuàng)建卷。

在以下示例中,您將安裝sshfs插件,驗證它是否已啟用,并使用它來創(chuàng)建卷。

注意:本示例僅用于說明目的。創(chuàng)建卷后,在檢查卷時,遠程主機的SSH密碼將作為純文本公開。您應(yīng)該在完成示例后立即刪除該卷。

  1. 安裝sshfs插件。$ docker 插件安裝 vieux / sshfs 插件“vieux / sshfs”正在請求以下權(quán)限: -  network:host  -  capabilities:CAP_SYS_ADMIN 您是否授予上述權(quán)限?y / N y vieux / sshfs 該插件請求2個權(quán)限:

- It needs access to the `host` network.- It needs the `CAP_SYS_ADMIN` capability, which allows the plugin to run the `mount` command.
  1. 檢查插件是否在輸出中啟用docker plugin ls。$ docker plugin ls ID名稱標(biāo)簽說明已啟用69553ca1d789 vieux / sshfs最新sshfs插件true

  2. 使用插件創(chuàng)建一個卷。本示例將/remote主機上的目錄掛載1.2.3.4到名為的卷中sshvolume。該卷現(xiàn)在可以安裝到容器中。$ docker volume create \ -d vieux / sshfs \ --name sshvolume \ -o sshcmd=user@1.2.3.4:/ remote \ -o password = $(cat file_containing_password_for_remote_host)sshvolume

  3. 確認卷已成功創(chuàng)建。$ docker卷ls DRIVER名稱vieux / sshfs sshvolume

  4. 啟動一個使用該卷的容器sshvolume。$ docker run --rm -v sshvolume:/ data busybox ls / data <機器上的/ remote的內(nèi)容1.2.3.4>

  5. 刪除卷sshvolume docker卷rm sshvolume sshvolume要禁用某個插件,請使用該docker plugin disable命令。要完全刪除它,請使用該docker plugin remove命令。有關(guān)其他可用的命令和選項,請參閱命令行參考。

開發(fā)一個插件

rootfs 目錄

rootfs目錄代表插件的根文件系統(tǒng)。在這個例子中,它是從 Dockerfile 創(chuàng)建的:

注意:/run/docker/plugins目錄在插件的文件系統(tǒng)內(nèi)部用于 docker 與插件進行通信。

$ git clone https://github.com/vieux/docker-volume-sshfs
$ cd docker-volume-sshfs
$ docker build -t rootfsimage .$ id=$(docker create rootfsimage true) # id was cd851ce43a403 when the image was created
$ sudo mkdir -p myplugin/rootfs
$ sudo docker export "$id" | sudo tar -x -C myplugin/rootfs
$ docker rm -vf "$id"$ docker rmi rootfsimage

config.json 文件

config.json文件描述了該插件。請參閱插件配置參考。

考慮下面的config.json文件。

{"description": "sshFS plugin for Docker","documentation": "https://docs.docker.com/engine/extend/plugins/","entrypoint": ["/docker-volume-sshfs"],"network": {   "type": "host"   },"interface" : {   "types": ["docker.volumedriver/1.0"],   "socket": "sshfs.sock"},"linux": {"capabilities": ["CAP_SYS_ADMIN"]}}

這個插件是一個音量驅(qū)動程序。它需要一個host網(wǎng)絡(luò)和CAP_SYS_ADMIN能力。它取決于/docker-volume-sshfs入口點并使用/run/docker/plugins/sshfs.sock套接字與Docker引擎進行通信。這個插件沒有運行時參數(shù)。

創(chuàng)建插件

通過運行docker plugin create <plugin-name> ./path/to/plugin/data插件數(shù)據(jù)包含插件配置文件config.json和子目錄中的根文件系統(tǒng),可以創(chuàng)建一個新的插件rootfs。

之后,插件<plugin-name>將顯示在docker plugin ls??梢允褂貌寮⒉寮扑偷竭h程注冊表docker plugin push <plugin-name>

調(diào)試插件

插件的 stdout 被重定向到 dockerd 日志。這些條目有一個plugin=<ID>后綴。以下是docker f52a3df433b9aceee436eaada0752f5797aab1de47e5485f1690a073b860ff62守護程序日志中 pluginID 及其相應(yīng)日志條目的幾個命令示例。

$ docker plugin install tiborvass/sample-volume-plugins

INFO[0036] Starting...       Found 0 volumes on startup  plugin=f52a3df433b9aceee436eaada0752f5797aab1de47e5485f1690a073b860ff62
$ docker volume create -d tiborvass/sample-volume-plugins samplevol

INFO[0193] Create Called...  Ensuring directory /data/samplevol exists on host...  plugin=f52a3df433b9aceee436eaada0752f5797aab1de47e5485f1690a073b860ff62
INFO[0193] open /var/lib/docker/plugin-data/local-persist.json: no such file or directory  plugin=f52a3df433b9aceee436eaada0752f5797aab1de47e5485f1690a073b860ff62
INFO[0193]                   Created volume samplevol with mountpoint /data/samplevol  plugin=f52a3df433b9aceee436eaada0752f5797aab1de47e5485f1690a073b860ff62
INFO[0193] Path Called...    Returned path /data/samplevol  plugin=f52a3df433b9aceee436eaada0752f5797aab1de47e5485f1690a073b860ff62
$ docker run -v samplevol:/tmp busybox sh

INFO[0421] Get Called...     Found samplevol                plugin=f52a3df433b9aceee436eaada0752f5797aab1de47e5485f1690a073b860ff62
INFO[0421] Mount Called...   Mounted samplevol              plugin=f52a3df433b9aceee436eaada0752f5797aab1de47e5485f1690a073b860ff62
INFO[0421] Path Called...    Returned path /data/samplevol  plugin=f52a3df433b9aceee436eaada0752f5797aab1de47e5485f1690a073b860ff62
INFO[0421] Unmount Called... Unmounted samplevol            plugin=f52a3df433b9aceee436eaada0752f5797aab1de47e5485f1690a073b860ff62

使用 docker-runc 將日志文件和 shell 獲取到插件中。

docker-runc,默認的 docker 容器運行時可用于調(diào)試插件。如果插件日志被重定向到文件,這特別有用。

$ docker-runc list
ID                                                                 PID         STATUS      BUNDLE                                                                                       CREATED
f52a3df433b9aceee436eaada0752f5797aab1de47e5485f1690a073b860ff62   2679        running     /run/docker/libcontainerd/f52a3df433b9aceee436eaada0752f5797aab1de47e5485f1690a073b860ff622017-02-06T21:53:03.031537592Z
r
$ docker-runc exec f52a3df433b9aceee436eaada0752f5797aab1de47e5485f1690a073b860ff62 cat /var/log/plugin.log

如果插件具有內(nèi)置的 shell,那么可以按照如下方式執(zhí)行插件:

$ docker-runc exec -t f52a3df433b9aceee436eaada0752f5797aab1de47e5485f1690a073b860ff62 sh

使用 curl 調(diào)試插件套接字問題。

要驗證 docker 守護程序與之通信的插件 API 套接字是否響應(yīng),請使用 curl。在本例中,我們將使用 curl 7.47.0 從 docker 主機到卷和網(wǎng)絡(luò)插件進行 API 調(diào)用,以確保插件正在偵聽所述套接字。對于運行良好的插件,這些基本要求應(yīng)該可以工作。請注意,插件套接字在主機下可用/var/run/docker/plugins/<pluginID>

curl -H "Content-Type: application/json" -XPOST -d '{}' --unix-socket /var/run/docker/plugins/e8a37ba56fc879c991f7d7921901723c64df6b42b87e6a0b055771ecf8477a6d/plugin.sock http:/VolumeDriver.List{"Mountpoint":"","Err":"","Volumes":[{"Name":"myvol1","Mountpoint":"/data/myvol1"},{"Name":"myvol2","Mountpoint":"/data/myvol2"}],"Volume":null}
curl -H "Content-Type: application/json" -XPOST -d '{}' --unix-socket /var/run/docker/plugins/45e00a7ce6185d6e365904c8bcf62eb724b1fe307e0d4e7ecc9f6c1eb7bcdb70/plugin.sock http:/NetworkDriver.GetCapabilities{"Scope":"local"}

當(dāng)使用 curl 7.5或更高版本時,URL應(yīng)該是表單的形式http://hostname/APICall,其中hostname是安裝插件的有效主機名,并且APICall是對插件 API 的調(diào)用。

例如, http://localhost/VolumeDriver.List

Previous article: Next article: