如何卸载docker让 Ansible 和 Docker 愉快地在一起

How to test Ansible playbook using Docker - Stack Overflow
Join the Stack Overflow Community
Stack Overflow is a community of 6.9 million programmers, just like you, helping each other.
J it only takes a minute:
I'm new to ansible (and docker). I would like to test my ansible playbook before using it on any staging/production servers.
Since I don't have access to an empty remote server, I thought the easiest way to test would be to use Docker container and then just run my playbook with the Docker container as the host.
I have a basic DockerFile that creates a standard ubuntu container. How would I configure the ansible hosts in order to run it against the docker container? Also, I suspect I would need to "run" the docker container to allow ansible to connect to it.
19.7k75991
Running the playbook in a docker container may not actually be the best approach unless your stage and production servers are also Docker containers. The Docker ubuntu image is stripped down and will have some differences from a full installation. A better option might be to run the playbook in an Ubuntu VM that matches your staging and production installations.
That said, in order to run the ansible playbook within the container you should write a Dockerfile that runs your playbook. Here's a sample Dockerfile:
# Start with the ubuntu image
FROM ubuntu
# Update apt cache
RUN apt-get -y update
# Install ansible dependencies
RUN apt-get install -y python-yaml python-jinja2 git
# Clone ansible repo (could also add the ansible PPA and do an apt-get install instead)
RUN git clone /ansible/ansible.git /tmp/ansible
# Set variables for ansible
WORKDIR /tmp/ansible
ENV PATH /tmp/ansible/bin:/sbin:/usr/sbin:/usr/bin
ENV ANSIBLE_LIBRARY /tmp/ansible/library
ENV PYTHONPATH /tmp/ansible/lib:$PYTHON_PATH
# add playbooks to the image. This might be a git repo instead
ADD playbooks/ /etc/ansible/
ADD inventory /etc/ansible/hosts
WORKDIR /etc/ansible
# Run ansible using the site.yml playbook
RUN ansible-playbook /etc/ansible/site.yml -c local
The ansible inventory file would look like
Then you can just docker build . (where . is the root of the directory where your playbooks and Dockerfile live), then docker run on the resulting image.
Michael DeHaan, the CTO of Ansible, has an informative .
13.5k13558
There's a working example regarding this:
First, choose the base image you'd like to begin with from the following list:
williamyeh/ansible:debian8-onbuild
williamyeh/ansible:debian7-onbuild
williamyeh/ansible:ubuntu14.04-onbuild
williamyeh/ansible:ubuntu12.04-onbuild
williamyeh/ansible:centos7-onbuild
williamyeh/ansible:centos6-onbuild
Second, put the following Dockerfile along with your playbook directory:
FROM williamyeh/ansible:ubuntu14.04-onbuild
# ==& Speci
default = "playbook.yml"
#ENV PLAYBOOK
playbook.yml
# ==& Specif
default = "/etc/ansible/hosts"
#ENV INVENTORY
inventory.ini
# ==& Executing Ansible...
RUN ansible-playbook-wrapper
Third, docker build .
For more advanced usage, the role in Ansible Galaxy
also demonstrates how to do a simple integration test for a variety of Linux distributions on ’s Ubuntu 12.04 worker instances.
Disclosure: I am the author of the docker-ansible and wiliamyeh/nginx projects.
I've created a role for this vary scenario: . Easily start Docker containers and use them in your role or playbook, as inventory, to test.
Curated Dockerfile for Ubuntu 12.04 & 14.04 as well as CentOS 6 & 7 that put back in the distro-removed init systems
Also note the examples all have a .travis.yml file to form a CI pipeline using Travis CI.
7,73023252
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
The week's top questions and answers
Important community announcements
Questions that need answers
By subscribing, you agree to the
rev .25469
Stack Overflow works best with JavaScript enabledKubernetes 和 Swarm 两种docker集群,基于ansible的自动化安装部署(已测)
Kubernetes 和 Swarm 两种docker集群,基于ansible的自动化安装部署(已测)
责任编辑:词汇网 发表时间: 2:09:34
Git repo:https://git.oschina.net/yonchin/k8s-x86_64/tree/master/x86?dir=1 650) this.width=650;" src="/wyfs02/M02/89/86/wKioL1gW3g_RTVF4AACoj-ZStpw544.png-wh_500x0-wm_3-wmp_4-s_.png" title="_140024.png" alt="wKioL1gW3g_RTVF4AACoj-ZStpw544.png-wh_50" />注:系统是基于CentOS_7.2,ansible:2.1简介:&kube-ansible-install: 除了安装Kubernetes的主从外,还包括Kubernetes的addons(如dashboard、dns、fluentd-elasticsearch-kibana、heapster-influxdb-grafana等),还包含zabbix、ftp、rsync的安装;&script:是管理Kubernetes的一些脚本;&kube-ansible-remove:是与kube-ansible-install的相反操作;&swarm-install: 以HA(高可用)的形式来安装swarm;&swarm-remove: 是与swarm-remove的相反操作。词汇网声明本文技术文章来自:51cto
上一集:没有了 下一集:
相关文章:&&&&&&&&&&&&
最新添加资讯
24小时热门资讯
附近好友搜索实例学习ansible系列(12)常用模块之docker - 博客频道 - CSDN.NET
知行合一 止于至善
分类:Ansible
知识点:ansible使用docker可以对其进行管理。基本接近docker-compose对docker的使用支持,非常接近。诸如从port的设定到volume_from都支持,但是需要docker-py0.3.0 以上的支持。
使用前提条件
需要使用docker的module的管理对象节点需要满足如下前提
0.3.0 以上
docker server
0.10.0 以上
安装docker-py
一般python等基本上无需意识,一般安装了docker-py本模块就能支持。
[root@host32 ~]
[root@host31 ~]
[root@host31 ~]
使用docker模块启动container
[root@host31 ~]
host32 | SUCCESS | rc=0 &&
REPOSITORY
docker.io/jenkins
2 weeks ago
CONTAINER ID
[root@host31 ~]
启动container
[root@host31 ~]
host32 | SUCCESS =& {
"ansible_facts": {
"docker_containers": [
"AppArmorProfile": "",
"/usr/local/bin/jenkins.sh"
"Config": {
"AttachStderr": false,
"AttachStdin": false,
"AttachStdout": false,
"Cmd": null,
"Domainname": "",
"Entrypoint": [
"/bin/tini",
"/usr/local/bin/jenkins.sh"
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"LANG=C.UTF-8",
"JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64",
"JAVA_VERSION=8u91",
"JAVA_DEBIAN_VERSION=8u91-b14-1~bpo8+1",
"CA_CERTIFICATES_JAVA_VERSION=",
"JENKINS_HOME=/var/jenkins_home",
"JENKINS_SLAVE_AGENT_PORT=50000",
"TINI_VERSION=0.9.0",
"TINI_SHA=fa23d1ebb8eeeca423c89ac80ed452",
"JENKINS_VERSION=2.7.1",
"JENKINS_SHA=12df586f7dbcfe72b95453",
"JENKINS_UC=https://updates.jenkins.io",
"COPY_REFERENCE_FILE_LOG=/var/jenkins_home/copy_reference_file.log"
"ExposedPorts": {
"50000/tcp": {},
"8080/tcp": {}
"Hostname": "a8e",
"Image": "docker.io/jenkins",
"Labels": {},
"OnBuild": null,
"OpenStdin": false,
"StdinOnce": false,
"Tty": false,
"User": "jenkins",
"Volumes": {
"/var/jenkins_home": {}
"WorkingDir": ""
"Created": "T03:03:38.Z",
"Driver": "devicemapper",
"ExecIDs": null,
"GraphDriver": {
"DeviceId": "25",
"DeviceName": "docker-253:0-17ff17acf430fada553119acb600654",
"DeviceSize": ""
"Name": "devicemapper"
"HostConfig": {
"Binds": null,
"BlkioDeviceReadBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceWriteIOps": null,
"BlkioWeight": 0,
"BlkioWeightDevice": null,
"CapAdd": null,
"CapDrop": null,
"CgroupParent": "",
"ConsoleSize": [
"ContainerIDFile": "",
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuShares": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": null,
"Dns": null,
"DnsOptions": null,
"DnsSearch": null,
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "",
"Isolation": "",
"KernelMemory": 0,
"Links": null,
"LogConfig": {
"Config": {},
"Type": "journald"
"Memory": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": -1,
"NetworkMode": "default",
"OomKillDisable": false,
"OomScoreAdj": 0,
"PidMode": "",
"PidsLimit": 0,
"PortBindings": {
"8080/tcp": [
"HostIp": "0.0.0.0",
"HostPort": "8080"
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"RestartPolicy": {
"MaximumRetryCount": 0,
"Name": ""
"SecurityOpt": null,
"ShmSize": ,
"UTSMode": "",
"Ulimits": null,
"VolumeDriver": "",
"VolumesFrom": null
"HostnamePath": "/var/lib/docker/containers/a8ef6b719c6b769fc72b4c44cc77f85c955/hostname",
"HostsPath": "/var/lib/docker/containers/a8ef6b719c6b769fc72b4c44cc77f85c955/hosts",
"Id": "a8ef6b719c6b769fc72b4c44cc77f85c955",
"Image": "sha256:bcc2dff04d2bad1c944983",
"LogPath": "",
"MountLabel": "system_u:object_r:svirt_sandbox_file_t:s0:c122,c287",
"Mounts": [
"Destination": "/var/jenkins_home",
"Driver": "local",
"Mode": "",
"Name": "2fdd9acb3d3b497ce12f9584afac3747a4baffea3e9bbc97a0411f",
"Propagation": "",
"RW": true,
"Source": "/var/lib/docker/volumes/2fdd9acb3d3b497ce12f9584afac3747a4baffea3e9bbc97a0411f/_data"
"Name": "/goofy_spence",
"NetworkSettings": {
"Bridge": "",
"EndpointID": "45fdef6e8fabe865ae0ab7faa39ca9e1624e6dea614d",
"Gateway": "172.16.96.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"HairpinMode": false,
"IPAddress": "172.16.96.2",
"IPPrefixLen": 24,
"IPv6Gateway": "",
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:10:60:02",
"Networks": {
"bridge": {
"Aliases": null,
"EndpointID": "45fdef6e8fabe865ae0ab7faa39ca9e1624e6dea614d",
"Gateway": "172.16.96.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAMConfig": null,
"IPAddress": "172.16.96.2",
"IPPrefixLen": 24,
"IPv6Gateway": "",
"Links": null,
"MacAddress": "02:42:ac:10:60:02",
"NetworkID": "320ec600ed83b717a5177b2eaf81c96cba34f3952b29"
"Ports": {
"50000/tcp": null,
"8080/tcp": [
"HostIp": "0.0.0.0",
"HostPort": "8080"
"SandboxID": "8ebecd4a57e50da61c0e669dddaf193cebc0c2fe0c5a523df0e2",
"SandboxKey": "/var/run/docker/netns/8ebecd9887e4",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null
"Path": "/bin/tini",
"ProcessLabel": "system_u:system_r:svirt_lxc_net_t:s0:c122,c287",
"ResolvConfPath": "/var/lib/docker/containers/a8ef6b719c6b769fc72b4c44cc77f85c955/resolv.conf",
"RestartCount": 0,
"State": {
"Dead": false,
"Error": "",
"ExitCode": 0,
"FinishedAt": "T00:00:00Z",
"OOMKilled": false,
"Paused": false,
"Pid": 30604,
"Restarting": false,
"Running": true,
"StartedAt": "T03:03:39.Z",
"Status": "running"
"changed": true,
"msg": "started 1 container, created 1 container.",
"reload_reasons": null,
"summary": {
"created": 1,
"killed": 0,
"pulled": 0,
"removed": 0,
"restarted": 0,
"started": 1,
"stopped": 0
[root@host31 ~]
[root@host31 ~]
host32 | SUCCESS | rc=0 &&
REPOSITORY
docker.io/jenkins
2 weeks ago
CONTAINER ID
283789b73a8e
docker.io/jenkins
"/bin/tini -- /usr/lo"
3 minutes ago
Up 3 minutes
0.0.0.0:8080-&8080/tcp, 50000/tcp
goofy_spence
[root@host31 ~]
停止container
实现docker stop 的操作
[root@host31 ~]
host32 | SUCCESS =& {
"ansible_facts": {
"docker_containers": [
"AppArmorProfile": "",
"/usr/local/bin/jenkins.sh"
"Config": {
"AttachStderr": false,
"AttachStdin": false,
"AttachStdout": false,
"Cmd": null,
"Domainname": "",
"Entrypoint": [
"/bin/tini",
"/usr/local/bin/jenkins.sh"
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"LANG=C.UTF-8",
"JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64",
"JAVA_VERSION=8u91",
"JAVA_DEBIAN_VERSION=8u91-b14-1~bpo8+1",
"CA_CERTIFICATES_JAVA_VERSION=",
"JENKINS_HOME=/var/jenkins_home",
"JENKINS_SLAVE_AGENT_PORT=50000",
"TINI_VERSION=0.9.0",
"TINI_SHA=fa23d1ebb8eeeca423c89ac80ed452",
"JENKINS_VERSION=2.7.1",
"JENKINS_SHA=12df586f7dbcfe72b95453",
"JENKINS_UC=https://updates.jenkins.io",
"COPY_REFERENCE_FILE_LOG=/var/jenkins_home/copy_reference_file.log"
"ExposedPorts": {
"50000/tcp": {},
"8080/tcp": {}
"Hostname": "a8e",
"Image": "docker.io/jenkins",
"Labels": {},
"OnBuild": null,
"OpenStdin": false,
"StdinOnce": false,
"Tty": false,
"User": "jenkins",
"Volumes": {
"/var/jenkins_home": {}
"WorkingDir": ""
"Created": "T03:03:38.Z",
"Driver": "devicemapper",
"ExecIDs": null,
"GraphDriver": {
"DeviceId": "25",
"DeviceName": "docker-253:0-17ff17acf430fada553119acb600654",
"DeviceSize": ""
"Name": "devicemapper"
"HostConfig": {
"Binds": null,
"BlkioDeviceReadBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceWriteIOps": null,
"BlkioWeight": 0,
"BlkioWeightDevice": null,
"CapAdd": null,
"CapDrop": null,
"CgroupParent": "",
"ConsoleSize": [
"ContainerIDFile": "",
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuShares": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": null,
"Dns": null,
"DnsOptions": null,
"DnsSearch": null,
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "",
"Isolation": "",
"KernelMemory": 0,
"Links": null,
"LogConfig": {
"Config": {},
"Type": "journald"
"Memory": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": -1,
"NetworkMode": "default",
"OomKillDisable": false,
"OomScoreAdj": 0,
"PidMode": "",
"PidsLimit": 0,
"PortBindings": {
"8080/tcp": [
"HostIp": "0.0.0.0",
"HostPort": "8080"
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"RestartPolicy": {
"MaximumRetryCount": 0,
"Name": ""
"SecurityOpt": null,
"ShmSize": ,
"UTSMode": "",
"Ulimits": null,
"VolumeDriver": "",
"VolumesFrom": null
"HostnamePath": "/var/lib/docker/containers/a8ef6b719c6b769fc72b4c44cc77f85c955/hostname",
"HostsPath": "/var/lib/docker/containers/a8ef6b719c6b769fc72b4c44cc77f85c955/hosts",
"Id": "a8ef6b719c6b769fc72b4c44cc77f85c955",
"Image": "sha256:bcc2dff04d2bad1c944983",
"LogPath": "",
"MountLabel": "system_u:object_r:svirt_sandbox_file_t:s0:c122,c287",
"Mounts": [
"Destination": "/var/jenkins_home",
"Driver": "local",
"Mode": "",
"Name": "2fdd9acb3d3b497ce12f9584afac3747a4baffea3e9bbc97a0411f",
"Propagation": "",
"RW": true,
"Source": "/var/lib/docker/volumes/2fdd9acb3d3b497ce12f9584afac3747a4baffea3e9bbc97a0411f/_data"
"Name": "/goofy_spence",
"NetworkSettings": {
"Bridge": "",
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"HairpinMode": false,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"MacAddress": "",
"Networks": {
"bridge": {
"Aliases": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAMConfig": null,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"Links": null,
"MacAddress": "",
"NetworkID": "320ec600ed83b717a5177b2eaf81c96cba34f3952b29"
"Ports": null,
"SandboxID": "8ebecd4a57e50da61c0e669dddaf193cebc0c2fe0c5a523df0e2",
"SandboxKey": "/var/run/docker/netns/8ebecd9887e4",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null
"Path": "/bin/tini",
"ProcessLabel": "system_u:system_r:svirt_lxc_net_t:s0:c122,c287",
"ResolvConfPath": "/var/lib/docker/containers/a8ef6b719c6b769fc72b4c44cc77f85c955/resolv.conf",
"RestartCount": 0,
"State": {
"Dead": false,
"Error": "",
"ExitCode": 143,
"FinishedAt": "T03:10:05.Z",
"OOMKilled": false,
"Paused": false,
"Restarting": false,
"Running": false,
"StartedAt": "T03:03:39.Z",
"Status": "exited"
"changed": true,
"msg": "stopped 1 container.",
"reload_reasons": null,
"summary": {
"created": 0,
"killed": 0,
"pulled": 0,
"removed": 0,
"restarted": 0,
"started": 0,
"stopped": 1
[root@host31 ~]
[root@host31 ~]
host32 | SUCCESS | rc=0 &&
REPOSITORY
docker.io/jenkins
2 weeks ago
CONTAINER ID
[root@host31 ~]
[root@host31 ~]
host32 | SUCCESS | rc=0 &&
CONTAINER ID
283789b73a8e
docker.io/jenkins
"/bin/tini -- /usr/lo"
7 minutes ago
Exited (143) About a minute ago
goofy_spence
[root@host31 ~]
删除container
实现docker rm的操作
[root@host31 ~]
host32 | SUCCESS | rc=0 &&
CONTAINER ID
283789b73a8e
docker.io/jenkins
"/bin/tini -- /usr/lo"
8 minutes ago
Exited (143) 2 minutes ago
goofy_spence
[root@host31 ~]
[root@host31 ~]
host32 | SUCCESS =& {
"ansible_facts": {
"docker_containers": [
"AppArmorProfile": "",
"/usr/local/bin/jenkins.sh"
"Config": {
"AttachStderr": false,
"AttachStdin": false,
"AttachStdout": false,
"Cmd": null,
"Domainname": "",
"Entrypoint": [
"/bin/tini",
"/usr/local/bin/jenkins.sh"
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"LANG=C.UTF-8",
"JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64",
"JAVA_VERSION=8u91",
"JAVA_DEBIAN_VERSION=8u91-b14-1~bpo8+1",
"CA_CERTIFICATES_JAVA_VERSION=",
"JENKINS_HOME=/var/jenkins_home",
"JENKINS_SLAVE_AGENT_PORT=50000",
"TINI_VERSION=0.9.0",
"TINI_SHA=fa23d1ebb8eeeca423c89ac80ed452",
"JENKINS_VERSION=2.7.1",
"JENKINS_SHA=12df586f7dbcfe72b95453",
"JENKINS_UC=https://updates.jenkins.io",
"COPY_REFERENCE_FILE_LOG=/var/jenkins_home/copy_reference_file.log"
"ExposedPorts": {
"50000/tcp": {},
"8080/tcp": {}
"Hostname": "a8e",
"Image": "docker.io/jenkins",
"Labels": {},
"OnBuild": null,
"OpenStdin": false,
"StdinOnce": false,
"Tty": false,
"User": "jenkins",
"Volumes": {
"/var/jenkins_home": {}
"WorkingDir": ""
"Created": "T03:03:38.Z",
"Driver": "devicemapper",
"ExecIDs": null,
"GraphDriver": {
"DeviceId": "25",
"DeviceName": "docker-253:0-17ff17acf430fada553119acb600654",
"DeviceSize": ""
"Name": "devicemapper"
"HostConfig": {
"Binds": null,
"BlkioDeviceReadBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceWriteIOps": null,
"BlkioWeight": 0,
"BlkioWeightDevice": null,
"CapAdd": null,
"CapDrop": null,
"CgroupParent": "",
"ConsoleSize": [
"ContainerIDFile": "",
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuShares": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": null,
"Dns": null,
"DnsOptions": null,
"DnsSearch": null,
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "",
"Isolation": "",
"KernelMemory": 0,
"Links": null,
"LogConfig": {
"Config": {},
"Type": "journald"
"Memory": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": -1,
"NetworkMode": "default",
"OomKillDisable": false,
"OomScoreAdj": 0,
"PidMode": "",
"PidsLimit": 0,
"PortBindings": {
"8080/tcp": [
"HostIp": "0.0.0.0",
"HostPort": "8080"
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"RestartPolicy": {
"MaximumRetryCount": 0,
"Name": ""
"SecurityOpt": null,
"ShmSize": ,
"UTSMode": "",
"Ulimits": null,
"VolumeDriver": "",
"VolumesFrom": null
"HostnamePath": "/var/lib/docker/containers/a8ef6b719c6b769fc72b4c44cc77f85c955/hostname",
"HostsPath": "/var/lib/docker/containers/a8ef6b719c6b769fc72b4c44cc77f85c955/hosts",
"Id": "a8ef6b719c6b769fc72b4c44cc77f85c955",
"Image": "sha256:bcc2dff04d2bad1c944983",
"LogPath": "",
"MountLabel": "system_u:object_r:svirt_sandbox_file_t:s0:c122,c287",
"Mounts": [
"Destination": "/var/jenkins_home",
"Driver": "local",
"Mode": "",
"Name": "2fdd9acb3d3b497ce12f9584afac3747a4baffea3e9bbc97a0411f",
"Propagation": "",
"RW": true,
"Source": "/var/lib/docker/volumes/2fdd9acb3d3b497ce12f9584afac3747a4baffea3e9bbc97a0411f/_data"
"Name": "/goofy_spence",
"NetworkSettings": {
"Bridge": "",
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"HairpinMode": false,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"MacAddress": "",
"Networks": {
"bridge": {
"Aliases": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAMConfig": null,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"Links": null,
"MacAddress": "",
"NetworkID": "320ec600ed83b717a5177b2eaf81c96cba34f3952b29"
"Ports": null,
"SandboxID": "8ebecd4a57e50da61c0e669dddaf193cebc0c2fe0c5a523df0e2",
"SandboxKey": "/var/run/docker/netns/8ebecd9887e4",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null
"Path": "/bin/tini",
"ProcessLabel": "system_u:system_r:svirt_lxc_net_t:s0:c122,c287",
"ResolvConfPath": "/var/lib/docker/containers/a8ef6b719c6b769fc72b4c44cc77f85c955/resolv.conf",
"RestartCount": 0,
"State": {
"Dead": false,
"Error": "",
"ExitCode": 143,
"FinishedAt": "T03:10:05.Z",
"OOMKilled": false,
"Paused": false,
"Restarting": false,
"Running": false,
"StartedAt": "T03:03:39.Z",
"Status": "exited"
"changed": true,
"msg": "removed 1 container.",
"reload_reasons": null,
"summary": {
"created": 0,
"killed": 0,
"pulled": 0,
"removed": 1,
"restarted": 0,
"started": 0,
"stopped": 0
[root@host31 ~]
[root@host31 ~]
host32 | SUCCESS | rc=0 &&
CONTAINER ID
[root@host31 ~]
排名:第6886名
(51)(21)(8)(16)(37)(17)(11)(3)(23)(8)(7)(2)(2)(1)(26)(1)(1)(2)(0)(0)(0)(0)(0)(0)(0)(0)(0)(0)

我要回帖

更多关于 如何重启docker服务 的文章

 

随机推荐