Debian Codegraph @

ansible_collections/community/docker/README.md

raw
1 <!--
2 Copyright (c) Ansible Project
3 GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
4 SPDX-License-Identifier: GPL-3.0-or-later
5 -->
6
7 # Docker Community Collection
8
9 [![Documentation](https://img.shields.io/badge/docs-brightgreen.svg)](https://docs.ansible.com/ansible/devel/collections/community/docker/)
10 [![Build Status](https://dev.azure.com/ansible/community.docker/_apis/build/status/CI?branchName=main)](https://dev.azure.com/ansible/community.docker/_build?definitionId=25)
11 [![Nox CI](https://github.com/ansible-collections/community.docker/actions/workflows/nox.yml/badge.svg?branch=main)](https://github.com/ansible-collections/community.docker/actions)
12 [![Codecov](https://img.shields.io/codecov/c/github/ansible-collections/community.docker)](https://codecov.io/gh/ansible-collections/community.docker)
13 [![REUSE status](https://api.reuse.software/badge/github.com/ansible-collections/community.docker)](https://api.reuse.software/info/github.com/ansible-collections/community.docker)
14
15 This repo contains the `community.docker` Ansible Collection. The collection includes many modules and plugins to work with Docker.
16
17 Please note that this collection does **not** support Windows targets. The connection plugins included in this collection support Windows targets on a best-effort basis, but we are not testing this in CI.
18
19 ## Code of Conduct
20
21 We follow [Ansible Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html) in all our interactions within this project.
22
23 If you encounter abusive behavior violating the [Ansible Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html), please refer to the [policy violations](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html#policy-violations) section of the Code of Conduct for information on how to raise a complaint.
24
25 ## Communication
26
27 * Join the Ansible forum:
28 * [Get Help](https://forum.ansible.com/c/help/6): get help or help others. Please add appropriate tags if you start new discussions, for example the `docker`, `docker-compose`, or `docker-swarm` tags.
29 * [Posts tagged with 'docker'](https://forum.ansible.com/tag/docker): subscribe to participate in Docker related conversations.
30 * [Posts tagged with 'docker-compose'](https://forum.ansible.com/tag/docker-compose): subscribe to participate in Docker Compose related conversations.
31 * [Posts tagged with 'docker-swarm'](https://forum.ansible.com/tag/docker-swarm): subscribe to participate in Docker Swarm related conversations.
32 * [Social Spaces](https://forum.ansible.com/c/chat/4): gather and interact with fellow enthusiasts.
33 * [News & Announcements](https://forum.ansible.com/c/news/5): track project-wide announcements including social events.
34
35 * The Ansible [Bullhorn newsletter](https://docs.ansible.com/ansible/devel/community/communication.html#the-bullhorn): used to announce releases and important changes.
36
37 For more information about communication, see the [Ansible communication guide](https://docs.ansible.com/ansible/devel/community/communication.html).
38
39 ## Tested with Ansible
40
41 Tested with the current ansible-core 2.17, ansible-core 2.18, ansible-core 2.19, ansible-core 2.20, ansible-core 2.21 releases, and the current development version of ansible-core. Ansible/ansible-base versions before 2.17.0 are not supported.
42
43 ## External requirements
44
45 Some modules and plugins require Docker CLI, or other external, programs. Some require the [Docker SDK for Python](https://pypi.org/project/docker/) and some use [requests](https://pypi.org/project/requests/) to directly communicate with the Docker daemon API. All modules and plugins require Python 2.7 or later. Python 2.6 is no longer supported; use community.docker 2.x.y if you need to use Python 2.6.
46
47 Installing the Docker SDK for Python also installs the requirements for the modules and plugins that use `requests`. If you want to directly install the Python libraries instead of the SDK, you need the following ones:
48
49 - [requests](https://pypi.org/project/requests/);
50 - [pywin32](https://pypi.org/project/pywin32/) when using named pipes on Windows with the Windows 32 API;
51 - [paramiko](https://pypi.org/project/paramiko/) when using SSH to connect to the Docker daemon with `use_ssh_client=false`;
52 - [pyOpenSSL](https://pypi.org/project/pyOpenSSL/) when using TLS to connect to the Docker daemon;
53 - [backports.ssl_match_hostname](https://pypi.org/project/backports.ssl_match_hostname/) when using TLS to connect to the Docker daemon on Python 2.
54
55 If you have Docker SDK for Python < 2.0.0 installed ([docker-py](https://pypi.org/project/docker-py/)), you can still use it for modules that support it, though we recommend to uninstall it and then install [docker](https://pypi.org/project/docker/), the Docker SDK for Python >= 2.0.0. Note that both libraries cannot be installed at the same time. If you accidentally did install them simultaneously, you have to uninstall *both* before re-installing one of them.
56
57 ## Collection Documentation
58
59 Browsing the [**latest** collection documentation](https://docs.ansible.com/ansible/latest/collections/community/docker) will show docs for the _latest version released in the Ansible package_, not the latest version of the collection released on Galaxy.
60
61 Browsing the [**devel** collection documentation](https://docs.ansible.com/ansible/devel/collections/community/docker) shows docs for the _latest version released on Galaxy_.
62
63 We also separately publish [**latest commit** collection documentation](https://ansible-collections.github.io/community.docker/branch/main/) which shows docs for the _latest commit in the `main` branch_.
64
65 If you use the Ansible package and do not update collections independently, use **latest**. If you install or update this collection directly from Galaxy, use **devel**. If you are looking to contribute, use **latest commit**.
66
67 ## Included content
68
69 * Connection plugins:
70 - community.docker.docker: use Docker containers as remotes using the Docker CLI program
71 - community.docker.docker_api: use Docker containers as remotes using the Docker API
72 - community.docker.nsenter: execute commands on the host running the controller container
73 * Inventory plugins:
74 - community.docker.docker_containers: dynamic inventory plugin for Docker containers
75 - community.docker.docker_machine: collect Docker machines as inventory
76 - community.docker.docker_swarm: collect Docker Swarm nodes as inventory
77 * Modules:
78 * Docker:
79 - community.docker.docker_container: manage Docker containers
80 - community.docker.docker_container_copy_into: copy a file into a Docker container
81 - community.docker.docker_container_exec: run commands in Docker containers
82 - community.docker.docker_container_info: retrieve information on Docker containers
83 - community.docker.docker_host_info: retrieve information on the Docker daemon
84 - community.docker.docker_image: manage Docker images
85 - community.docker.docker_image_build: build Docker images using Docker buildx
86 - community.docker.docker_image_export: export (archive) Docker images
87 - community.docker.docker_image_info: retrieve information on Docker images
88 - community.docker.docker_image_load: load Docker images from archives
89 - community.docker.docker_image_pull: pull Docker images from registries
90 - community.docker.docker_image_push: push Docker images to registries
91 - community.docker.docker_image_remove: remove Docker images
92 - community.docker.docker_image_tag: tag Docker images with new names and/or tags
93 - community.docker.docker_login: log in and out to/from registries
94 - community.docker.docker_network: manage Docker networks
95 - community.docker.docker_network_info: retrieve information on Docker networks
96 - community.docker.docker_plugin: manage Docker plugins
97 - community.docker.docker_prune: prune Docker containers, images, networks, volumes, and build data
98 - community.docker.docker_volume: manage Docker volumes
99 - community.docker.docker_volume_info: retrieve information on Docker volumes
100 * Docker Compose:
101 - community.docker.docker_compose_v2: manage Docker Compose files (Docker compose CLI plugin)
102 - community.docker.docker_compose_v2_exec: run command in a container of a Compose service
103 - community.docker.docker_compose_v2_pull: pull a Docker compose project
104 - community.docker.docker_compose_v2_run: run command in a new container of a Compose service
105 * Docker Swarm:
106 - community.docker.docker_config: manage configurations
107 - community.docker.docker_node: manage Docker Swarm nodes
108 - community.docker.docker_node_info: retrieve information on Docker Swarm nodes
109 - community.docker.docker_secret: manage secrets
110 - community.docker.docker_swarm: manage Docker Swarm
111 - community.docker.docker_swarm_info: retrieve information on Docker Swarm
112 - community.docker.docker_swarm_service: manage Docker Swarm services
113 - community.docker.docker_swarm_service_info: retrieve information on Docker Swarm services
114 * Docker Stack:
115 - community.docker.docker_stack: manage Docker Stacks
116 - community.docker.docker_stack_info: retrieve information on Docker Stacks
117 - community.docker.docker_stack_task_info: retrieve information on tasks in Docker Stacks
118 * Other:
119 - current_container_facts: return facts about whether the module runs in a Docker container
120
121 ## Using this collection
122
123 Before using the Docker community collection, you need to install the collection with the `ansible-galaxy` CLI:
124
125 ansible-galaxy collection install community.docker
126
127 You can also include it in a `requirements.yml` file and install it via `ansible-galaxy collection install -r requirements.yml` using the format:
128
129 ```yaml
130 collections:
131 - name: community.docker
132 ```
133
134 See [Ansible Using collections](https://docs.ansible.com/ansible/latest/user_guide/collections_using.html) for more details.
135
136 ## Contributing to this collection
137
138 If you want to develop new content for this collection or improve what is already here, the easiest way to work on the collection is to clone it into one of the configured [`COLLECTIONS_PATH`](https://docs.ansible.com/ansible/latest/reference_appendices/config.html#collections-paths), and work on it there.
139
140 You can find more information in the [developer guide for collections](https://docs.ansible.com/ansible/devel/dev_guide/developing_collections.html#contributing-to-collections), and in the [Ansible Community Guide](https://docs.ansible.com/ansible/latest/community/index.html).
141
142 ## Release notes
143
144 See the [changelog](https://github.com/ansible-collections/community.docker/tree/main/CHANGELOG.md).
145
146 ## More information
147
148 - [Ansible Collection overview](https://github.com/ansible-collections/overview)
149 - [Ansible User guide](https://docs.ansible.com/ansible/latest/user_guide/index.html)
150 - [Ansible Developer guide](https://docs.ansible.com/ansible/latest/dev_guide/index.html)
151 - [Ansible Collections Checklist](https://github.com/ansible-collections/overview/blob/master/collection_requirements.rst)
152 - [Ansible Community code of conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html)
153 - [The Bullhorn (the Ansible Contributor newsletter)](https://us19.campaign-archive.com/home/?u=56d874e027110e35dea0e03c1&id=d6635f5420)
154 - [Changes impacting Contributors](https://github.com/ansible-collections/overview/issues/45)
155
156 ## Licensing
157
158 This collection is primarily licensed and distributed as a whole under the GNU General Public License v3.0 or later.
159
160 See [LICENSES/GPL-3.0-or-later.txt](https://github.com/ansible-collections/community.docker/blob/main/COPYING) for the full text.
161
162 Parts of the collection are licensed under the [Apache 2.0 license](https://github.com/ansible-collections/community.docker/blob/main/LICENSES/Apache-2.0.txt). This mostly applies to files vendored from the [Docker SDK for Python](https://github.com/docker/docker-py/).
163
164 All files have a machine readable `SDPX-License-Identifier:` comment denoting its respective license(s) or an equivalent entry in an accompanying `.license` file. Only changelog fragments (which will not be part of a release) are covered by a blanket statement in `REUSE.toml`. This conforms to the [REUSE specification](https://reuse.software/spec/).