This repo contains the community.docker
Ansible Collection. The collection includes many modules and plugins to work with Docker.
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.
We follow Ansible Code of Conduct in all our interactions within this project.
If you encounter abusive behavior violating the Ansible Code of Conduct, please refer to the policy violations section of the Code of Conduct for information on how to raise a complaint.
Join the Ansible forum:
The Ansible Bullhorn newsletter: used to announce releases and important changes.
For more information about communication, see the Ansible communication guide.
Tested with the current ansible-core 2.11, ansible-core 2.12, ansible-core 2.13, ansible-core 2.14, ansible-core 2.15, ansible-core 2.16, and ansible-core 2.17 releases, and the current development version of ansible-core. Ansible/ansible-base versions before 2.11.0 are not supported.
Please note that Ansible 2.9 and ansible-base 2.10 are no longer supported. If you need to use them, use community.docker 2.x.y. Also note that this collection does not work with ansible-core 2.11 (this includes ansible-base and Ansible 2.9) on Python 3.12+.
Some modules and plugins require Docker CLI, or other external, programs. Some require the Docker SDK for Python and some use 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.
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:
use_ssh_client=false
;If you have Docker SDK for Python < 2.0.0 installed (docker-py), you can still use it for modules that support it, though we recommend to uninstall it and then install 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.
Browsing the latest collection documentation will show docs for the latest version released in the Ansible package, not the latest version of the collection released on Galaxy.
Browsing the devel collection documentation shows docs for the latest version released on Galaxy.
We also separately publish latest commit collection documentation which shows docs for the latest commit in the main
branch.
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.
Before using the Docker community collection, you need to install the collection with the ansible-galaxy
CLI:
ansible-galaxy collection install community.docker
You can also include it in a requirements.yml
file and install it via ansible-galaxy collection install -r requirements.yml
using the format:
collections:
- name: community.docker
See Ansible Using collections for more details.
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
, and work on it there.
You can find more information in the developer guide for collections, and in the Ansible Community Guide.
See the changelog.
This collection is primarily licensed and distributed as a whole under the GNU General Public License v3.0 or later.
See LICENSES/GPL-3.0-or-later.txt for the full text.
Parts of the collection are licensed under the Apache 2.0 license. This mostly applies to files vendored from the Docker SDK for Python.
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/dep5
. This conforms to the REUSE specification.