Community.Docker 发行说明
v4.1.0
发行摘要
Bug 修复和功能发布。
次要变更
docker_stack - 允许向
docker stack deploy
命令添加--detach=false
选项 (https://github.com/ansible-collections/community.docker/pull/987)。
Bug 修复
docker_compose_v2_exec, docker_compose_v2_run - 修复组装 env 参数时缺少
--env
标志 (https://github.com/ansible-collections/community.docker/pull/992)。docker_host_info - 确保模块始终返回
can_talk_to_docker
,并且即使指定了api_version
,它也会提供正确的值 (https://github.com/ansible-collections/community.docker/issues/993, https://github.com/ansible-collections/community.docker/pull/995)。
v4.0.1
发行摘要
Bug 修复版本。
Bug 修复
docker_compose_v2_run - 确保在将
labels
发送到 Docker 守护进程之前对其进行清理 (https://github.com/ansible-collections/community.docker/pull/985)。docker_config - 确保在将
labels
发送到 Docker 守护进程之前对其进行清理 (https://github.com/ansible-collections/community.docker/pull/985)。docker_network - 确保在将
labels
发送到 Docker 守护进程之前对其进行清理 (https://github.com/ansible-collections/community.docker/pull/985)。docker_node - 确保在将
labels
发送到 Docker 守护进程之前对其进行清理 (https://github.com/ansible-collections/community.docker/pull/985)。docker_secret - 确保在将
labels
发送到 Docker 守护进程之前对其进行清理 (https://github.com/ansible-collections/community.docker/pull/985)。docker_swarm - 确保在将
labels
发送到 Docker 守护进程之前对其进行清理 (https://github.com/ansible-collections/community.docker/pull/985)。docker_swarm_service - 确保在将
labels
和container_labels
发送到 Docker 守护进程之前对其进行清理 (https://github.com/ansible-collections/community.docker/pull/985)。docker_volume - 确保在将
labels
发送到 Docker 守护进程之前对其进行清理 (https://github.com/ansible-collections/community.docker/pull/985)。
v4.0.0
发行摘要
删除了已弃用功能的主要版本。
次要变更
docker_compose_v2 - 为
docker compose up
添加renew_anon_volumes
参数 (https://github.com/ansible-collections/community.docker/pull/977)。
重大变更/移植指南
docker_container -
image_name_mismatch
的默认值从ignore
更改为recreate
(https://github.com/ansible-collections/community.docker/pull/971)。
已移除的功能(之前已弃用)
此集合不再支持 ansible-core 2.11、2.12、2.13 和 2.14。您需要 ansible-core 2.15.0 或更高版本才能使用 community.docker 4.x.y (https://github.com/ansible-collections/community.docker/pull/971)。
docker_compose 模块已被移除。请迁移到 community.docker.docker_compose_v2 (https://github.com/ansible-collections/community.docker/pull/971)。
docker_container -
ignore_image
选项已被移除。请在comparisons
中使用image: ignore
代替 (https://github.com/ansible-collections/community.docker/pull/971)。docker_container -
purge_networks
选项已被移除。请在comparisons
中使用networks: strict
代替,并确保指定了networks
(https://github.com/ansible-collections/community.docker/pull/971)。各种模块和插件 - 移除
ssl_version
选项 (https://github.com/ansible-collections/community.docker/pull/971)。
v3.13.1
发行摘要
Bug 修复版本。
Bug修复
docker_compose_v2 - 改进了从 JSON 事件解析 dry-run 镜像构建操作 (https://github.com/ansible-collections/community.docker/issues/975, https://github.com/ansible-collections/community.docker/pull/976)。
v3.13.0
发行摘要
功能发布。
新模块
community.docker.docker_compose_v2_exec - 在 Compose 服务的容器中运行命令。
community.docker.docker_compose_v2_run - 在 Compose 服务的新容器中运行命令。
v3.12.2
发行摘要
Bug 修复版本。
Bug修复
docker_prune - 修复了 filter 选项的列表处理 (https://github.com/ansible-collections/community.docker/issues/961, https://github.com/ansible-collections/community.docker/pull/966)。
v3.12.1
发行摘要
维护版本,更新了文档和变更日志。
已弃用的功能
此集合弃用了对所有当前已停止生命周期的 ansible-core 版本的支持,根据 ansible-core 支持矩阵。这意味着此集合的下一个主要版本将不再支持 ansible-core 2.11、ansible-core 2.12、ansible-core 2.13 和 ansible-core 2.14。
v3.12.0
发行摘要
Bug 修复和功能发布。
小的更改
docker、docker_api 连接插件 - 允许使用新的
working_dir
选项确定执行命令时的工作目录 (https://github.com/ansible-collections/community.docker/pull/943)。docker、docker_api 连接插件 - 允许使用新的
privileges
选项执行具有扩展权限的命令 (https://github.com/ansible-collections/community.docker/pull/943)。docker、docker_api 连接插件 - 允许使用新的
extra_env
选项在执行命令时传递额外的环境变量 (https://github.com/ansible-collections/community.docker/issues/937, https://github.com/ansible-collections/community.docker/pull/940)。docker_compose_v2* 模块 - 支持 Docker Compose 2.29.0 的
json
进度写入器,以避免必须解析文本输出 (https://github.com/ansible-collections/community.docker/pull/931)。docker_compose_v2_pull - 添加新选项
ignore_buildable
、include_deps
和services
(https://github.com/ansible-collections/community.docker/issues/941, https://github.com/ansible-collections/community.docker/pull/942)。docker_container - 在创建容器时,直接将要连接的所有网络传递给 API 版本 1.44 及更高版本的 Docker Daemon。这使创建更高效,并解决了 Docker Daemon 中至少在某些情况下不使用指定 MAC 地址的错误,尽管仅适用于创建 (https://github.com/ansible-collections/community.docker/pull/933)。
Bug修复
docker_compose_v2 - 处理 2.29.0 之前的 Compose 版本输出的另一个随机非结构化错误 (https://github.com/ansible-collections/community.docker/issues/948, https://github.com/ansible-collections/community.docker/pull/949)。
docker_compose_v2 - 确保
services
中提供的服务附加在--
之后,而不是之前 (https://github.com/ansible-collections/community.docker/pull/942)。docker_compose_v2* 模块、docker_image_build - 当
docker version
或docker info
输出中不存在必填字段时,提供更好的错误消息。如果使用 Podman 而不是 Docker,则可能发生这种情况 (https://github.com/ansible-collections/community.docker/issues/891, https://github.com/ansible-collections/community.docker/pull/935)。docker_container - 如果使用
network_mode=default
和 Docker 26.1.0 或更高版本,则修复幂等性。Docker 26.1.0 中关于NetworkMode
的规范化存在重大变更 (https://github.com/ansible-collections/community.docker/issues/934, https://github.com/ansible-collections/community.docker/pull/936)。docker_container - 从 community.docker 2.x.y 恢复模块的行为,该模块在创建容器时将第一个网络传递给 Docker Deamon (https://github.com/ansible-collections/community.docker/pull/933)。
docker_image_build - 修复
type=docker
和type=image
的--output
参数组成 (https://github.com/ansible-collections/community.docker/issues/946, https://github.com/ansible-collections/community.docker/pull/947)。
已知问题
docker_container - 在为容器网络指定 MAC 地址时,并且网络是在容器创建后附加的(例如,由于幂等性检查),MAC 地址至少在某些情况下会被 Docker Daemon 忽略 (https://github.com/ansible-collections/community.docker/pull/933)。
v3.11.0
小的更改
docker_container - 添加对
device_cgroup_rules
的支持 (https://github.com/ansible-collections/community.docker/pull/910)。docker_container - 新的
state=healthy
允许在启动时等待容器变为 healthy。healthy_wait_timeout
选项允许配置等待这种情况发生的最长时间 (https://github.com/ansible-collections/community.docker/issues/890, https://github.com/ansible-collections/community.docker/pull/921)。
Bug修复
docker_compose_v2* 模块 - 修复 Docker Compose 2.28.x 的跳过拉取消息的解析 (https://github.com/ansible-collections/community.docker/issues/911, https://github.com/ansible-collections/community.docker/pull/916)。
docker_compose_v2*、docker_stack*、docker_image_build 模块 - 使用
cli_context
不再导致将无效的参数组合传递给相应的 Docker CLI 工具,除非还提供了docker_host
。不再允许组合cli_context
和docker_host
(https://github.com/ansible-collections/community.docker/issues/892, https://github.com/ansible-collections/community.docker/pull/895)。docker_container - 修复设置了
removal_wait_timeout
时可能发生的无限循环 (https://github.com/ansible-collections/community.docker/pull/922)。为 Python 供应商提供的 Docker SDK - 使用
LooseVersion
而不是StrictVersion
来比较 urllib3 版本。这是开发版本所必需的 (https://github.com/ansible-collections/community.docker/pull/902)。
v3.10.4
发布摘要
Bug 修复版本。
错误修复
docker_compose - 确保模块使用
api_version
参数 (https://github.com/ansible-collections/community.docker/pull/881)。docker_compose_v2* 模块 - 没有检查以确保提供了
project_src
和definition
中的一个。如果两者都没有提供,模块会崩溃 (https://github.com/ansible-collections/community.docker/issues/885, https://github.com/ansible-collections/community.docker/pull/886)。
v3.10.3
发布摘要
Bug 修复版本。
错误修复
docker 和 nsenter 连接插件,docker_container_exec 模块 - 避免在 Python 3 中使用已弃用的
ansible.module_utils.compat.selectors
模块实用程序 (https://github.com/ansible-collections/community.docker/issues/870, https://github.com/ansible-collections/community.docker/pull/871)。
v3.10.2
发布摘要
Bug 修复版本。
错误修复
供应商提供的 Docker SDK for Python - 包括一个修复 requests 2.32.2+ 兼容性的补丁 (https://github.com/ansible-collections/community.docker/issues/860, https://github.com/psf/requests/issues/6707, https://github.com/ansible-collections/community.docker/pull/864)。
v3.10.1
发布摘要
requests 2.32.0 兼容性的热修复版本。
错误修复
供应商提供的 Docker SDK for Python - 包括 requests 2.32.0 兼容性的热修复补丁 (https://github.com/ansible-collections/community.docker/issues/860, https://github.com/docker/docker-py/issues/3256, https://github.com/ansible-collections/community.docker/pull/861)。
已知问题
请注意,community.docker 3.10.1 中包含的 requests 2.32.0 的修复仅修复了供应商提供的 Docker SDK for Python 代码的问题。由于 SDK 目前与 requests 2.32.0 不兼容,使用 Docker SDK for Python 的模块和插件仍然可能失败。
如果您仍然遇到 requests 2.32.0 的问题,例如
Not supported URL scheme http+docker
等错误消息,请将 requests 限制为<2.32.0
。
v3.10.0
发布摘要
功能发布。
次要更改
docker_container - 添加
healthcheck.start_interval
以支持容器上的健康检查启动间隔设置 (https://github.com/ansible-collections/community.docker/pull/848)。docker_container - 添加
healthcheck.test_cli_compatible
以允许在不删除现有镜像测试的情况下省略容器上的测试选项 (https://github.com/ansible-collections/community.docker/pull/847)。docker_image_build - 添加
outputs
选项以允许配置构建的输出 (https://github.com/ansible-collections/community.docker/pull/852)。docker_image_build - 添加
secrets
选项以允许将密钥传递给构建 (https://github.com/ansible-collections/community.docker/pull/852)。docker_image_build - 允许
platform
是平台列表,而不仅仅是多平台构建的单个平台 (https://github.com/ansible-collections/community.docker/pull/852)。docker_network - 添加
config_only
和config_from
以支持创建和使用仅配置网络 (https://github.com/ansible-collections/community.docker/issues/395)。docker_prune - 添加新选项
builder_cache_all
、builder_cache_filters
和builder_cache_keep_storage
,以及用于修剪构建缓存的新返回值builder_cache_caches_deleted
(https://github.com/ansible-collections/community.docker/issues/844, https://github.com/ansible-collections/community.docker/issues/845)。docker_swarm_service - 添加
sysctls
以支持 swarm 服务上的 sysctl 设置 (https://github.com/ansible-collections/community.docker/issues/190)。
已弃用功能
docker_compose - Docker Compose v1 模块已弃用,将从 community.docker 4.0.0 中删除。请迁移到
community.docker.docker_compose_v2
模块,该模块与 Docker Compose v2 一起使用 (https://github.com/ansible-collections/community.docker/issues/823, https://github.com/ansible-collections/community.docker/pull/833)。各种模块和插件 -
ssl_version
选项已弃用,将从 community.docker 4.0.0 中删除。它已从 Docker SDK for Python 7.0.0 中删除,过去仅在解决 SSL/TLS 问题时才需要 (https://github.com/ansible-collections/community.docker/pull/853)。
v3.9.0
发布摘要
Bug 修复和功能发布。
次要更改
EE 要求现在包括 PyYAML,因为当使用
definition
选项时,docker_compose_v2*
模块依赖于它。这不应该对生成的 EE 产生明显的影响,因为 ansible-core 本身也依赖于 PyYAML,并且 ansible-builder 明确忽略此依赖项 (https://github.com/ansible-collections/community.docker/pull/832)。docker_compose_v2* - 新选项
check_files_existing
允许在未指定files
的情况下,禁用对project_src
中compose.yaml
、compose.yml
、docker-compose.yaml
和docker-compose.yml
其中一个文件的检查。如果通过其他方式指定了非标准的 compose 文件名,例如COMPOSE_FILE
环境变量,则这是必要的 (https://github.com/ansible-collections/community.docker/issues/838, https://github.com/ansible-collections/community.docker/pull/839)。docker_compose_v2* 模块 - 允许提供 compose 内容的内联定义,而不必提供包含写入的 compose 文件的
project_src
目录 (https://github.com/ansible-collections/community.docker/issues/829, https://github.com/ansible-collections/community.docker/pull/832)。供应商提供的 Docker SDK for Python - 删除依赖于 Python 3.12 中已弃用功能的未使用的代码 (https://github.com/ansible-collections/community.docker/pull/834)。
错误修复
docker_compose_v2* - 允许
project_src
是相对路径,通过在使用它之前将其转换为绝对路径 (https://github.com/ansible-collections/community.docker/issues/827, https://github.com/ansible-collections/community.docker/pull/828)。docker_compose_v2* 模块 - 当 Docker Compose CLI 插件版本为
dev
时,会中止并显示友好的错误消息,而不是崩溃 (https://github.com/ansible-collections/community.docker/issues/825, https://github.com/ansible-collections/community.docker/pull/826)。inventory 插件 - 添加不安全包装器以避免将不包含
{
或}
的字符串标记为不安全,以解决 AWX 中的一个错误 (https://github.com/ansible-collections/community.docker/pull/835)。
v3.8.1
发布摘要
错误修复版本
安全修复
docker_containers、docker_machine 和 docker_swarm inventory 插件 - 确保从 Docker 守护程序 / Docker 机器接收的所有数据都被标记为不安全,因此不可能通过获取可以评估为模板的文本来执行远程代码 (https://www.die-welt.net/2024/03/remote-code-execution-in-ansible-dynamic-inventory-plugins/, https://github.com/ansible-collections/community.docker/pull/815)。
Bugfixes(错误修复)
docker_compose_v2 - 当发生非致命错误时,不要失败。当拉取镜像失败时可能会发生这种情况,但之后可以为另一个服务构建该镜像。在这种情况下,Docker Compose 会发出错误,但
docker compose up
仍然会成功完成(https://github.com/ansible-collections/community.docker/issues/807, https://github.com/ansible-collections/community.docker/pull/810, https://github.com/ansible-collections/community.docker/pull/811)。docker_compose_v2* 模块 - 正确解析 Docker Compose 发出的
Warning
事件(https://github.com/ansible-collections/community.docker/issues/807, https://github.com/ansible-collections/community.docker/pull/811)。docker_compose_v2* 模块 - 解析 Docker Compose 发出的
logfmt
警告(https://github.com/ansible-collections/community.docker/issues/787, https://github.com/ansible-collections/community.docker/pull/811)。docker_compose_v2_pull - 通过检查实际拉取进度事件而不是服务级别的拉取请求来修复幂等性(当
policy=always
时)。当拉取没有发生实际更改时,这可以阻止模块报告changed=true
。在检查模式下,它必须假设发生更改(https://github.com/ansible-collections/community.docker/issues/813, https://github.com/ansible-collections/community.docker/pull/814)。
v3.8.0
发布摘要
Bug 修复和功能发布。
次要更改
docker_compose_v2 - 允许在使用新的
wait
选项运行docker compose up
时,等待容器运行/健康(https://github.com/ansible-collections/community.docker/issues/794, https://github.com/ansible-collections/community.docker/pull/796)。docker_container -
pull_check_mode_behavior
选项现在允许在pull=always
时控制模块在检查模式下的行为(https://github.com/ansible-collections/community.docker/issues/792, https://github.com/ansible-collections/community.docker/pull/797)。docker_container -
pull
选项现在接受三个值never
、missing_image
(默认值) 和never
,以及先前有效的值true
(等效于always
) 和false
(等效于missing_image
)。这允许等效于 Docker 命令行中的--pull=never
(https://github.com/ansible-collections/community.docker/issues/783, https://github.com/ansible-collections/community.docker/pull/797)。
Bugfixes(错误修复)
docker_compose_v2 - 不要将
Waiting
事件视为操作/更改(https://github.com/ansible-collections/community.docker/pull/804)。docker_compose_v2 - 不要将服务级别的拉取事件视为更改,以避免在
pull=always
时返回不正确的changed=true
值(https://github.com/ansible-collections/community.docker/issues/802, https://github.com/ansible-collections/community.docker/pull/803)。docker_compose_v2, docker_compose_v2_pull - 修复 Docker Compose 2.20.0 的拉取消息解析(https://github.com/ansible-collections/community.docker/issues/785, https://github.com/ansible-collections/community.docker/pull/786)。
v3.7.0
发布摘要
Bug 修复和功能发布。
次要更改
docker_compose_v2 - 添加
scale
选项,允许显式缩放服务(https://github.com/ansible-collections/community.docker/pull/776)。docker_compose_v2, docker_compose_v2_pull - 支持
files
参数以指定多个 Compose 文件(https://github.com/ansible-collections/community.docker/issues/772, https://github.com/ansible-collections/community.docker/pull/775)。
Bugfixes(错误修复)
docker_compose_v2 - 正确解析来自
stderr
的干运行构建事件(https://github.com/ansible-collections/community.docker/issues/778, https://github.com/ansible-collections/community.docker/pull/779)。docker_compose_v2_pull - 该模块被记录为
community.docker.docker
操作组的一部分,但实际上不是。现在已经修复了(https://github.com/ansible-collections/community.docker/pull/773)。
新模块
community.docker.docker_image_export - 导出 (归档) Docker 镜像
v3.6.0
发布摘要
Bug 修复和功能发布。
该集合现在包含一些新的 docker_image_*
模块,这些模块将功能从相当复杂的 docker_image
模块中移出。这些新模块更容易使用,并且可以更好地声明它们是否支持检查模式、差异模式或都不支持。
此版本还具有支持 Docker CLI 插件 buildx
和 compose
的模块。docker_image_build
模块在后台使用 docker buildx
命令,而 docker_compose_v2
和 docker_compose_v2_pull
模块使用 docker compose
命令。所有这些模块都使用 Docker CLI 而不是直接与 API 通信。这些模块支持与基于 API 的模块大致相同的接口,因此主要区别在于它们依赖于 Docker CLI 工具 docker
,而不是一些 Python 要求。
主要更改
community.docker
集合现在依赖于community.library_inventory_filtering_v1
集合。此实用程序集合为清单插件提供主机过滤功能。如果您使用 Ansible 社区包,则两个集合都包含在内,您无需执行任何特殊操作。如果您使用ansible-galaxy collection install
安装集合,它将自动安装。如果您通过将集合的文件复制到 ansible-core 可以找到它的位置来安装集合,例如通过克隆 git 存储库,则您需要确保在使用清单插件时也必须安装依赖项(https://github.com/ansible-collections/community.docker/pull/698)。
次要更改
几乎所有模块和插件可用的
ca_cert
选项已重命名为ca_path
。ca_path
名称也用于 ansible-core 和其他集合中的类似选项。旧名称已添加为别名,仍可使用(https://github.com/ansible-collections/community.docker/pull/744)。docker_stack*
模块现在使用为docker_image_build
和docker_compose_v2
模块添加的通用基于 CLI 的模块代码。这意味着这些模块现在在与 Docker 守护程序通信方面有更多配置选项,并且现在也是community.docker.docker
和docker
模块默认组的一部分(https://github.com/ansible-collections/community.docker/pull/745)。docker_container - 为 Docker API 1.44+ 添加
networks[].mac_address
选项。请注意,Docker API 1.44 不再使用全局mac_address
选项,此新选项是设置容器 MAC 地址的唯一方法(https://github.com/ansible-collections/community.docker/pull/763)。docker_image - 允许在构建镜像时指定标签和
/dev/shm
大小 (https://github.com/ansible-collections/community.docker/issues/726, https://github.com/ansible-collections/community.docker/pull/727)。docker_image - 允许以字节以外的单位指定内存大小和交换内存大小 (https://github.com/ansible-collections/community.docker/pull/727)。
inventory plugins - 添加
filter
选项,允许基于 Jinja2 条件包含和排除主机 (https://github.com/ansible-collections/community.docker/pull/698, https://github.com/ansible-collections/community.docker/issues/610)。
Bugfixes
使用
unix:///var/run/docker.sock
而不是传统的unix://var/run/docker.sock
作为docker_host
的默认值 (https://github.com/ansible-collections/community.docker/pull/736)。docker_image - 修复了 Docker API 1.44 或更高版本时的归档幂等性问题 (https://github.com/ansible-collections/community.docker/pull/765)。
新模块
community.docker.docker_compose_v2 - 使用 Docker Compose CLI 插件管理多容器 Docker 应用程序
community.docker.docker_compose_v2_pull - 拉取 Docker compose 项目
community.docker.docker_image_build - 使用 Docker buildx 构建 Docker 镜像
community.docker.docker_image_pull - 从注册中心拉取 Docker 镜像
community.docker.docker_image_push - 将 Docker 镜像推送到注册中心
community.docker.docker_image_remove - 删除 Docker 镜像
community.docker.docker_image_tag - 使用新名称和/或标签标记 Docker 镜像
v3.5.0
发布摘要
Bug 修复和功能发布。
次要更改
docker_container - 实施更好的
platform
字符串比较以提高幂等性 (https://github.com/ansible-collections/community.docker/issues/654, https://github.com/ansible-collections/community.docker/pull/705)。docker_container - 内部重构,允许比较使用更多信息,例如当前镜像的详细信息或 Docker 主机配置 (https://github.com/ansible-collections/community.docker/pull/713)。
已弃用功能
docker_container -
image_name_mismatch
参数的默认ignore
已被弃用,将在 community.docker 4.0.0 中切换为recreate
。在默认值被使用且行为将因默认更改而改变的情况下,将打印弃用警告 (https://github.com/ansible-collections/community.docker/pull/703)。
Bugfixes
使用 Python 的 Docker SDK 的模块和插件 - 从传递给 Python 7.0.0+ 的 Docker SDK 的参数中删除
ssl_version
。如果在此情况下显式设置了该参数,则显式失败并显示更友好的错误消息 (https://github.com/ansible-collections/community.docker/pull/715)。使用 Python 的 Docker SDK 的模块和插件 - 从传递给 Python 7.0.0+ 的 Docker SDK 的参数中删除
tls_hostname
。如果在此情况下显式设置了该参数,则显式失败并显示更友好的错误消息 (https://github.com/ansible-collections/community.docker/pull/721)。捆绑的 Python Docker SDK - 如果用户没有提供
ssl_version
和tls_hostname
,则避免传递它们。删除无用代码。(https://github.com/ansible-collections/community.docker/pull/722)。
v3.4.11
发布摘要
Bug 修复版本。
Bugfixes
docker_volume - 修复了访问空字典导致的崩溃。由于
self.existing_volume["Labels"]
字典为None
,has_different_config()
引发了AttributeError
(https://github.com/ansible-collections/community.docker/pull/702)。
v3.4.10
发布摘要
Bug 修复版本。
Bugfixes
docker_swarm - 使初始化和加入操作再次与 4.0.0 之前的 Python Docker SDK 一起工作 (https://github.com/ansible-collections/community.docker/issues/695, https://github.com/ansible-collections/community.docker/pull/696)。
v3.4.9
发布摘要
维护版本,其中更新了文档和捆绑的 Python Docker SDK 代码。
Bugfixes
捆绑的 Python Docker SDK 代码 - 从 Python Docker SDK 代码中挑选更改以对齐代码。这些更改不应影响集合代码使用的部分 (https://github.com/ansible-collections/community.docker/pull/694)。
v3.4.8
发布摘要
维护版本,其中更新了文档。
从此版本开始,community.docker 在其文档中使用新的 Ansible 语义标记。如果您使用 2.15 之前的 ansible-core 的 ansible-doc CLI 工具查看文档,请注意它不会正确呈现标记。在大多数情况下,您仍然可以阅读它,但是您需要 ansible-core 2.15 或更高版本才能按预期查看它。或者,您可以查看 devel 文档站点以获取最新版本的文档的渲染 HTML 版本。
已知问题
对于 2.15 之前的 ansible-core,Ansible 标记将在 ansible-doc 文本输出中以原始形式显示。如果您在解读文档标记时遇到问题,请升级到 ansible-core 2.15(或更高版本),或阅读 https://docs.ansible.org.cn/ansible/devel/collections/community/docker/ 上的 HTML 文档。
v3.4.7
发布摘要
Bug 修复版本。
Bugfixes
docker_swarm_info - 如果使用
service=true
,则在遇到没有端点规范的服务时不会崩溃 (https://github.com/ansible-collections/community.docker/issues/636, https://github.com/ansible-collections/community.docker/pull/637)。
v3.4.6
发布摘要
Bugfix 版本,其中包含有关使用 TCP TLS 连接到 Docker 守护程序时使用某些功能的文档警告。
Bugfixes
socket_handler 模块实用程序 - 确保在 Python 的 Docker SDK 不可用时完全正常工作 (https://github.com/ansible-collections/community.docker/pull/620)。
捆绑的 Python Docker SDK 代码 - 修复了 Windows 上管道关闭时的错误 (https://github.com/ansible-collections/community.docker/pull/619)。
捆绑的 Python Docker SDK 代码 - 遵守 Windows 命名管道的超时 (https://github.com/ansible-collections/community.docker/pull/619)。
捆绑的 Python Docker SDK 代码 - 除了 Windows 之外,使用
poll()
而不是select()
(https://github.com/ansible-collections/community.docker/pull/619)。
已知问题
docker_api 连接插件 - 不适用于 TCP TLS 套接字!这是因为无法在不使用 Python 的
SSLSocket
关闭连接的情况下发送close_notify
TLS 警报 (https://github.com/ansible-collections/community.docker/issues/605, https://github.com/ansible-collections/community.docker/pull/621)。docker_container_exec - 当使用
stdin
选项时,不适用于 TCP TLS 套接字!这是因为无法在不使用 Python 的SSLSocket
关闭连接的情况下发送close_notify
TLS 警报 (https://github.com/ansible-collections/community.docker/issues/605, https://github.com/ansible-collections/community.docker/pull/621)。
v3.4.5
发布摘要
维护版本,增加了对 requests 2.29.0 和 2.30.0 以及 urllib3 2.0 的兼容性。
Bugfixes
使捆绑的 Python Docker SDK 代码与 requests 2.29.0 和 urllib3 2.0 兼容 (https://github.com/ansible-collections/community.docker/pull/613)。
v3.4.4
发布摘要
维护版本,更新了 EE 要求和更新了文档。
次要更改
限制请求版本低于 2.29.0,并且 urllib3 版本低于 2.0.0。这是必要的,直到 Docker SDK for Python 的 vendored 代码完全调整为与 requests 2.29.0 开始使用的 urllib3 的功能一起工作(https://github.com/ansible-collections/community.docker/issues/611,https://github.com/ansible-collections/community.docker/pull/612)。
已知问题
使用 Docker SDK for Python 的 vendored 代码的模块和插件目前无法与 requests 2.29.0 和/或 urllib3 2.0.0 一起工作。Docker SDK for Python 本身的最新版本目前也是如此(https://github.com/ansible-collections/community.docker/issues/611,https://github.com/ansible-collections/community.docker/pull/612)。
v3.4.3
发布摘要
维护版本,改进了文档。
v3.4.2
发布摘要
Bug 修复版本。
Bug修复
docker_prune - 返回正确的
changed
值。到目前为止,该模块始终声称没有任何更改(https://github.com/ansible-collections/community.docker/pull/593)。
v3.4.1
发布摘要
常规错误修复版本。
Bug修复
docker_api 连接插件、docker_container_exec、docker_container_copy_into - 在容器中执行命令后正确关闭与守护进程的套接字(https://github.com/ansible-collections/community.docker/pull/582)。
docker_container - 修复
tmfs_size
和tmpfs_mode
未设置的问题(https://github.com/ansible-collections/community.docker/pull/580)。各种插件和模块 - 删除不必要的导入(https://github.com/ansible-collections/community.docker/pull/574)。
v3.4.0
发布摘要
常规错误修复和功能发布。
次要更改
docker_api 连接插件 - 当从容器复制文件或向容器复制文件时,流式传输文件内容,而不是先将其读取到内存中(https://github.com/ansible-collections/community.docker/pull/545)。
docker_host_info - 允许使用新选项
containers_all
列出所有容器(https://github.com/ansible-collections/community.docker/issues/535,https://github.com/ansible-collections/community.docker/pull/538)。
Bug修复
docker_api 连接插件 - 修复当 Docker 守护进程返回 409 Conflict(针对已停止的容器)时的错误处理(https://github.com/ansible-collections/community.docker/pull/546)。
docker_container_exec - 修复当 Docker 守护进程返回 409 Conflict(针对已停止的容器)时的错误处理(https://github.com/ansible-collections/community.docker/pull/546)。
docker_plugin - 如果插件在检查模式下安装,则不会崩溃(https://github.com/ansible-collections/community.docker/issues/552,https://github.com/ansible-collections/community.docker/pull/553)。
大多数模块 - 修复
DOCKER_TIMEOUT
环境变量的处理,并改进其他回退环境变量的处理(https://github.com/ansible-collections/community.docker/issues/551,https://github.com/ansible-collections/community.docker/pull/554)。
新模块
community.docker.docker_container_copy_into - 将文件复制到 Docker 容器中
v3.3.2
发布摘要
Bug 修复版本。
Bug修复
docker_container - 当
detach=false
时,无限期等待,而不是最多一分钟。这是 Docker SDK for Python 的行为,在 3.0.0 中被意外更改(https://github.com/ansible-collections/community.docker/issues/526,https://github.com/ansible-collections/community.docker/pull/527)。
v3.3.1
发布摘要
Bug 修复版本。
Bug修复
current_container_facts - 使容器检测在更多情况下更好地工作(https://github.com/ansible-collections/community.docker/pull/522)。
v3.3.0
发布摘要
功能和错误修复版本。
次要更改
current_container_facts - 使其与当前的 Docker 版本一起使用,也支持 Podman(https://github.com/ansible-collections/community.docker/pull/510)。
docker_image - 当使用
archive_path
时,根据镜像 ID(哈希)检测是否需要更改。如果现有的 tar 存档与源匹配,则不执行任何操作。以前,每次任务执行都会重新创建存档(https://github.com/ansible-collections/community.docker/pull/500)。
Bug修复
docker_container_exec - 修复自 community.docker 3.0.0 以来被忽略的
chdir
选项(https://github.com/ansible-collections/community.docker/issues/517,https://github.com/ansible-collections/community.docker/pull/518)。vendored 最新的 Docker SDK for Python bugfix(https://github.com/ansible-collections/community.docker/pull/513,https://github.com/docker/docker-py/issues/3045)。
v3.2.2
发布摘要
Bug 修复版本。
Bug修复
docker_container - 自 3.0.0 以来,
kill_signal
选项错误地不再接受字符串(https://github.com/ansible-collections/community.docker/issues/505,https://github.com/ansible-collections/community.docker/pull/506)。
v3.2.1
发布摘要
维护版本,改进了文档。
v3.2.0
发布摘要
功能和弃用版本。
次要更改
docker_container - 添加了
image_name_mismatch
选项,该选项允许控制容器使用指定的映像时的行为,但容器的配置使用的映像名称与提供给模块的名称不同(https://github.com/ansible-collections/community.docker/issues/485,https://github.com/ansible-collections/community.docker/pull/488)。
已弃用的功能
docker_container -
ignore_image
选项已弃用,将在 community.docker 4.0.0 中移除。请改用comparisons
中的image: ignore
(https://github.com/ansible-collections/community.docker/pull/487)。docker_container -
purge_networks
选项已弃用,将在 community.docker 4.0.0 中移除。请改用comparisons
中的networks: strict
,并确保提供networks
,如果要移除所有网络,则其值为[]
(https://github.com/ansible-collections/community.docker/pull/487)。
v3.1.0
版本摘要
功能发布。
次要更改
除了更新日志片段外,该集合存储库符合 REUSE 规范 (https://github.com/ansible-collections/community.docker/pull/462)。
docker_swarm - 允许在初始化 swarm 时使用
data_path_port
参数 (https://github.com/ansible-collections/community.docker/issues/296)。
v3.0.2
版本摘要
Bug 修复版本。
错误修复
v3.0.1
版本摘要
Bug 修复版本。
错误修复
docker_container - 修复
env_file
的处理 (https://github.com/ansible-collections/community.docker/issues/451, https://github.com/ansible-collections/community.docker/pull/452)。
v3.0.0
版本摘要
3.0.0 版本对 docker_container
模块进行了重写,并且许多模块和插件不再依赖于 Docker SDK for Python。
重大更改
该集合现在包含来自 Docker SDK for Python 的供应商代码,用于与 Docker 守护进程通信。使用此代码的模块和插件不再需要在运行模块或插件的机器上安装 Docker SDK for Python (https://github.com/ansible-collections/community.docker/pull/398)。
docker_api 连接插件 - 不再使用 Docker SDK for Python。它需要安装
requests
,并且根据所使用的功能还有一些其他要求。如果安装了 Docker SDK for Python,则很可能满足这些要求 (https://github.com/ansible-collections/community.docker/pull/414)。docker_container - 不再使用 Docker SDK for Python。它需要安装
requests
,并且根据所使用的功能还有一些其他要求。如果安装了 Docker SDK for Python,则很可能满足这些要求 (https://github.com/ansible-collections/community.docker/pull/422)。docker_container - 该模块已完全从头开始重写 (https://github.com/ansible-collections/community.docker/pull/422)。
docker_container_exec - 不再使用 Docker SDK for Python。它需要安装
requests
,并且根据所使用的功能还有一些其他要求。如果安装了 Docker SDK for Python,则很可能满足这些要求 (https://github.com/ansible-collections/community.docker/pull/401)。docker_container_info - 不再使用 Docker SDK for Python。它需要安装
requests
,并且根据所使用的功能还有一些其他要求。如果安装了 Docker SDK for Python,则很可能满足这些要求 (https://github.com/ansible-collections/community.docker/pull/402)。docker_containers 清单插件 - 不再使用 Docker SDK for Python。它需要安装
requests
,并且根据所使用的功能还有一些其他要求。如果安装了 Docker SDK for Python,则很可能满足这些要求 (https://github.com/ansible-collections/community.docker/pull/413)。docker_host_info - 不再使用 Docker SDK for Python。它需要安装
requests
,并且根据所使用的功能还有一些其他要求。如果安装了 Docker SDK for Python,则很可能满足这些要求 (https://github.com/ansible-collections/community.docker/pull/403)。docker_image - 不再使用 Docker SDK for Python。它需要安装
requests
,并且根据所使用的功能还有一些其他要求。如果安装了 Docker SDK for Python,则很可能满足这些要求 (https://github.com/ansible-collections/community.docker/pull/404)。docker_image_info - 不再使用 Docker SDK for Python。它需要安装
requests
,并且根据所使用的功能还有一些其他要求。如果安装了 Docker SDK for Python,则很可能满足这些要求 (https://github.com/ansible-collections/community.docker/pull/405)。docker_image_load - 不再使用 Docker SDK for Python。它需要安装
requests
,并且根据所使用的功能还有一些其他要求。如果安装了 Docker SDK for Python,则很可能满足这些要求 (https://github.com/ansible-collections/community.docker/pull/406)。docker_login - 不再使用 Docker SDK for Python。它需要安装
requests
,并且根据所使用的功能还有一些其他要求。如果安装了 Docker SDK for Python,则很可能满足这些要求 (https://github.com/ansible-collections/community.docker/pull/407)。docker_network - 不再使用 Docker SDK for Python。它需要安装
requests
,并且根据所使用的功能还有一些其他要求。如果安装了 Docker SDK for Python,则很可能满足这些要求 (https://github.com/ansible-collections/community.docker/pull/408)。docker_network_info - 不再使用 Docker SDK for Python。它需要安装
requests
,并且根据所使用的功能还有一些其他要求。如果安装了 Docker SDK for Python,则很可能满足这些要求 (https://github.com/ansible-collections/community.docker/pull/409)。docker_plugin - 不再使用 Docker SDK for Python。它需要安装
requests
,并且根据所使用的功能还有一些其他要求。如果安装了 Docker SDK for Python,则很可能满足这些要求 (https://github.com/ansible-collections/community.docker/pull/429)。docker_prune - 不再使用 Docker SDK for Python。它需要安装
requests
,并且根据所使用的功能还有一些其他要求。如果安装了 Docker SDK for Python,则很可能满足这些要求 (https://github.com/ansible-collections/community.docker/pull/410)。docker_volume - 不再使用 Docker SDK for Python。它需要安装
requests
,并且根据所使用的功能还有一些其他要求。如果安装了 Docker SDK for Python,则很可能满足这些要求 (https://github.com/ansible-collections/community.docker/pull/411)。docker_volume_info - 不再使用 Docker SDK for Python。它需要安装
requests
,并且根据所使用的功能还有一些其他要求。如果安装了 Docker SDK for Python,则很可能满足这些要求 (https://github.com/ansible-collections/community.docker/pull/412)。
次要更改
所有软件许可现在都位于集合根目录的
LICENSES/
目录中。此外,SPDX-License-Identifier:
用于声明每个非自动生成的文件适用的许可证 (https://github.com/ansible-collections/community.docker/pull/430)。移除
distutils.version
的 vendor 副本,转而使用 ansible-core 2.12+ 中包含的 vendor 副本。对于 ansible-core 2.11,Python < 3.12 使用distutils.version
。不支持 Python 3.12+ 的 ansible-core 2.11 (https://github.com/ansible-collections/community.docker/pull/271)。docker_container - 添加新参数
image_comparison
来控制用于幂等性检查的镜像的行为 (https://github.com/ansible-collections/community.docker/issues/421, https://github.com/ansible-collections/community.docker/pull/428)。docker_container - 添加对
cgroupns_mode
的支持 (https://github.com/ansible-collections/community.docker/issues/338, https://github.com/ansible-collections/community.docker/pull/427)。docker_container - 允许指定
platform
(https://github.com/ansible-collections/community.docker/issues/123, https://github.com/ansible-collections/community.docker/pull/426)。直接与 Docker 守护进程通信的模块和插件 - 改进 Python 3.6 及更高版本的默认 TLS 版本选择。这只是相对于较旧的 community.docker 3.0.0 预发布版本或 Docker SDK for Python < 6.0.0 的更改。Docker SDK for Python 6.0.0 也将包含此更改 (https://github.com/ansible-collections/community.docker/pull/434)。
直接与 Docker 守护进程通信的模块和插件 - 简化了在 Docker SDK for Python 中删除的用于查找可执行文件的辅助函数的使用 (https://github.com/ansible-collections/community.docker/pull/438)。
socker_handler 和 socket_helper 模块实用程序 - 改进 Python 向前兼容性,创建用于文件阻塞/取消阻塞的辅助函数 (https://github.com/ansible-collections/community.docker/pull/415)。
重大更改/移植指南
此集合不适用于 Python 3.12+ 上的 ansible-core 2.11。请升级到 ansible-core 2.12+,或使用 Python 3.11 或更早版本 (https://github.com/ansible-collections/community.docker/pull/271)。
docker_container -
exposed_ports
在comparisons
中不再被忽略。之前,它的值被假设为与published_ports
的值相同 (https://github.com/ansible-collections/community.docker/pull/422)。docker_container - 当未指定
log_driver
时,不能再指定log_options
(https://github.com/ansible-collections/community.docker/pull/422)。docker_container -
publish_all_ports
在comparisons
中不再被忽略 (https://github.com/ansible-collections/community.docker/pull/422)。docker_container - 当未指定
restart_policy
时,不能再指定restart_retries
(https://github.com/ansible-collections/community.docker/pull/422)。docker_container - 如果在
comparisons
中明确要求不忽略,则stop_timeout
不再被幂等性忽略。到目前为止,它在那里默认为ignore
,并且将其设置为strict
没有效果 (https://github.com/ansible-collections/community.docker/pull/422)。直接与 Docker 守护进程通信的模块和插件 - 当通过 SSH 连接且不使用
use_ssh_client=true
时,拒绝未知的 host key,而不是接受它们。这只是相对于较旧的 community.docker 3.0.0 预发布版本或 Docker SDK for Python < 6.0.0 的一个重大更改。Docker SDK for Python 6.0.0 也将包含此更改 (https://github.com/ansible-collections/community.docker/pull/434)。
删除的功能(之前已弃用)
使用 community.docker 构建的执行环境不再包含 docker-compose < 2.0.0。如果需要在
docker_compose
模块中使用它,请手动安装该要求 (https://github.com/ansible-collections/community.docker/pull/400)。已删除对 Ansible 2.9 和 ansible-base 2.10 的支持。如果需要对 Ansible 2.9 或 ansible-base 2.10 的支持,请使用 community.docker 2.x.y (https://github.com/ansible-collections/community.docker/pull/400)。
已删除对 Docker API 版本 1.20 到 1.24 的支持。如果需要支持这些 API 版本,请使用 community.docker 2.x.y (https://github.com/ansible-collections/community.docker/pull/400)。
已删除对 Python 2.6 的支持。如果需要支持 Python 2.6,请使用 community.docker 2.x.y (https://github.com/ansible-collections/community.docker/pull/400)。
各种模块 - 已删除
tls_hostname
(localhost
) 的默认值。如果想继续使用localhost
,则需要显式指定它 (https://github.com/ansible-collections/community.docker/pull/363)。docker_container -
published_ports
中不再允许使用all
值。请改用publish_all_ports=true
(https://github.com/ansible-collections/community.docker/pull/399)。docker_container -
command_handling
的默认值已从compatibility
更改为correct
。当这会导致行为改变时,旧版本会针对模块的每次调用发出警告 (https://github.com/ansible-collections/community.docker/pull/399)。docker_stack - 返回值
out
和err
已被删除。请改用stdout
和stderr
(https://github.com/ansible-collections/community.docker/pull/363)。
安全修复
直接与 Docker 守护进程通信的模块和插件 - 当通过 SSH 连接且不使用
use_ssh_client=true
时,拒绝未知的 host key,而不是接受它们。这只是相对于较旧的 community.docker 3.0.0 预发布版本或 Docker SDK for Python < 6.0.0 的一个更改。Docker SDK for Python 6.0.0 也将包含此更改 (https://github.com/ansible-collections/community.docker/pull/434)。
Bug 修复
docker_image - 在构成构建上下文时,从
.dockerignore
条目中修剪尾随空格。这只是相对于较旧的 community.docker 3.0.0 预发布版本或 Docker SDK for Python < 6.0.0 的更改。Docker SDK for Python 6.0.0 也将包含此更改 (https://github.com/ansible-collections/community.docker/pull/434)。docker_plugin - 修复处理插件选项时发生的崩溃 (https://github.com/ansible-collections/community.docker/issues/446, https://github.com/ansible-collections/community.docker/pull/447)。
docker_stack - 修复当
compose
包含无效值时报告错误时损坏的字符串格式 (https://github.com/ansible-collections/community.docker/pull/448)。直接与 Docker 守护进程通信的模块和插件 - 当使用
use_ssh_client=true
时,不要为 SSH 连接创建子 shell。这只是相对于较旧的 community.docker 3.0.0 预发布版本或 Docker SDK for Python < 6.0.0 的更改。Docker SDK for Python 6.0.0 也将包含此更改 (https://github.com/ansible-collections/community.docker/pull/434)。直接与 Docker 守护进程通信的模块和插件 - 修复当不使用
use_ssh_client=true
时,SSH 连接的ProxyCommand
处理。这只是相对于较旧的 community.docker 3.0.0 预发布版本或 Docker SDK for Python < 6.0.0 的更改。Docker SDK for Python 6.0.0 也将包含此更改 (https://github.com/ansible-collections/community.docker/pull/434)。直接与 Docker 守护进程通信的模块和插件 - 修复在
docker_host
中解析带端口的 IPv6 地址。这只是相对于较旧的 community.docker 3.0.0 预发布版本或 Docker SDK for Python < 6.0.0 的更改。Docker SDK for Python 6.0.0 也将包含此更改 (https://github.com/ansible-collections/community.docker/pull/434)。直接与 Docker 守护进程通信的模块和插件 - 防止在使用 TLS 时崩溃 (https://github.com/ansible-collections/community.docker/pull/432)。
v2.7.0
发布摘要
错误修复和弃用版本。接下来的 2.x.y 版本将仅为错误修复版本,下一个预期的次要/主要版本将是 3.0.0,其中包含一些重大更改。
次要更改
将通用实用程序函数从
common
module_util 移动到名为util
的新 module_util。这不应该有任何用户可见的影响 (https://github.com/ansible-collections/community.docker/pull/390)。
已弃用的功能
对 Docker API 版本 1.20 到 1.24 的支持已被弃用,将在 community.docker 3.0.0 中删除。第一个支持 API 版本 1.25 的 Docker 版本是 2017 年 1 月发布的 Docker 1.13。这会影响模块
docker_container
、docker_container_exec
、docker_container_info
、docker_compose
、docker_login
、docker_image
、docker_image_info
、docker_image_load
、docker_host_info
、docker_network
、docker_network_info
、docker_node_info
、docker_swarm_info
、docker_swarm_service
、docker_swarm_service_info
、docker_volume_info
和docker_volume
,这些模块支持的最低 API 版本在 1.20 和 1.24 之间 (https://github.com/ansible-collections/community.docker/pull/396)。对 Python 2.6 的支持已被弃用,将在下一个主要版本(community.docker 3.0.0)中删除。某些模块可能仍然可以使用 Python 2.6,但我们将不再尝试确保兼容性 (https://github.com/ansible-collections/community.docker/pull/388)。
错误修复
基于 Python 的 Docker SDK 模块和插件 - 如果 API 版本被指定为选项,则使用该版本来验证模块/插件选项的 API 版本要求,而不是 Docker 守护进程支持的最新 API 版本。这还可以避免每个模块/插件的不必要的 API 调用 (https://github.com/ansible-collections/community.docker/pull/389)。
v2.6.0
版本摘要
Bug 修复和功能发布。
次要更改
docker_container - 添加了
image_label_mismatch
参数 (https://github.com/ansible-collections/community.docker/issues/314, https://github.com/ansible-collections/community.docker/pull/370)。
已弃用的功能
对 Ansible 2.9 和 ansible-base 2.10 的支持已被弃用,将在下一个主要版本(community.docker 3.0.0)中删除。之后某些模块可能仍然可以使用这些版本,但我们将不再保留支持它们所需的兼容性代码 (https://github.com/ansible-collections/community.docker/pull/361)。
对执行环境的 docker-compose 依赖已被弃用,将在 community.docker 3.0.0 中删除。Python docker-compose 库 未维护,可能会导致依赖问题。您仍然可以在需要时手动将其安装在执行环境中 (https://github.com/ansible-collections/community.docker/pull/373)。
各种模块 - 本应在 community.docker 2.0.0 中删除的
tls_hostname
的默认值现在将在 3.0.0 版本中删除 (https://github.com/ansible-collections/community.docker/pull/362)。docker_stack - 本应在 community.docker 2.0.0 中删除的返回值
out
和err
现在将在 3.0.0 版本中删除 (https://github.com/ansible-collections/community.docker/pull/362)。
错误修复
docker_container - 如果指定的端口具有三个以上冒号分隔的部分,则使用有意义的消息而不是崩溃失败 (https://github.com/ansible-collections/community.docker/pull/367, https://github.com/ansible-collections/community.docker/issues/365)。
docker_container - 删除将导致 Python 3.13 出现问题的未使用代码 (https://github.com/ansible-collections/community.docker/pull/354)。
v2.5.1
版本摘要
维护版本。
错误修复
为
plugins/module_utils/_version.py
包括PSF-license.txt
文件。
v2.5.0
版本摘要
定期功能版本。
次要更改
docker_config - 添加对
template_driver
的支持,其中一个选项为golang
(https://github.com/ansible-collections/community.docker/issues/332, https://github.com/ansible-collections/community.docker/pull/345)。docker_swarm - 在 swarm 初始化或加入时添加
data_path_addr
参数 (https://github.com/ansible-collections/community.docker/issues/339)。
v2.4.0
版本摘要
定期功能和错误修复版本。
次要更改
通过声明其依赖项,为包含在执行环境中准备集合。不支持
docker_stack*
模块 (https://github.com/ansible-collections/community.docker/pull/336)。current_container_facts - 添加对 GitHub Actions 的检测 (https://github.com/ansible-collections/community.docker/pull/336)。
docker_container - 支持在使用 Docker 的
local
日志记录驱动程序时返回 Docker 容器日志输出,这是 Docker 18.09 中引入的优化的本地日志记录驱动程序 (https://github.com/ansible-collections/community.docker/pull/337)。
错误修复
docker 连接插件 - 确保
docker_extra_args
用于查询 Docker 版本。还确保仅在需要时才查询 Docker 版本。如果指定了远程用户,则目前是这种情况 (https://github.com/ansible-collections/community.docker/issues/325, https://github.com/ansible-collections/community.docker/pull/327)。
v2.3.0
版本摘要
定期功能和错误修复版本。
次要更改
docker 连接插件 - 通过清除内部容器用户缓存来实现连接重置 (https://github.com/ansible-collections/community.docker/pull/312)。
docker 连接插件 - 简化
actual_user
处理代码 (https://github.com/ansible-collections/community.docker/pull/311)。docker 连接插件 - 该插件支持定义超时的新方法。它们是
ANSIBLE_DOCKER_TIMEOUT
环境变量,ansible.cfg
的docker_connection
部分中的timeout
设置,以及ansible_docker_timeout
变量 (https://github.com/ansible-collections/community.docker/pull/297)。docker_api 连接插件 - 通过清除内部容器用户/组 ID 缓存来实现连接重置(https://github.com/ansible-collections/community.docker/pull/312)。
docker_api 连接插件 - 该插件支持新的超时定义方式。它们是
ANSIBLE_DOCKER_TIMEOUT
环境变量,ansible.cfg
文件中docker_connection
部分的timeout
设置,以及ansible_docker_timeout
变量(https://github.com/ansible-collections/community.docker/pull/308)。
Bug 修复
docker 连接插件 - 修复选项处理,使其与 ansible-core 2.13 兼容(https://github.com/ansible-collections/community.docker/pull/297,https://github.com/ansible-collections/community.docker/issues/307)。
docker_api 连接插件 - 修复选项处理,使其与 ansible-core 2.13 兼容(https://github.com/ansible-collections/community.docker/pull/308)。
v2.2.1
版本概要
常规错误修复版本。
Bug 修复
docker_compose - 修复从 docker-compose 的输出中提取警告或错误时出现的 Python 3 类型错误(https://github.com/ansible-collections/community.docker/pull/305)。
v2.2.0
版本概要
定期功能和错误修复版本。
小的改动
docker_config - 添加滚动更新的支持,将
rolling_versions
设置为true
以启用(https://github.com/ansible-collections/community.docker/pull/295,https://github.com/ansible-collections/community.docker/issues/109)。docker_secret - 添加滚动更新的支持,将
rolling_versions
设置为true
以启用(https://github.com/ansible-collections/community.docker/pull/293,https://github.com/ansible-collections/community.docker/issues/21)。docker_swarm_service - 添加使用
cap_add
和cap_drop
参数设置 capabilities 的支持。用法与docker_container
的capabilities
和cap_drop
参数相同(https://github.com/ansible-collections/community.docker/pull/294)。
Bug 修复
docker_container, docker_image - 调整镜像查找代码以适应使用像
redis
这样的 Docker 短名称时podman-docker
的 API 模拟的特性(https://github.com/ansible-collections/community.docker/issues/292)。
v2.1.1
版本概要
紧急发布,以修正先前版本中的重大更改。
Bug 修复
修复因 先前修复导致的意外重大更改,方法是捆绑已弃用的 Python 标准库
distutils.version
,直到此集合停止支持 Ansible 2.9 和 ansible-base 2.10(https://github.com/ansible-collections/community.docker/issues/267,https://github.com/ansible-collections/community.docker/pull/269)。
v2.1.0
版本概要
功能和错误修复版本。
小的改动
docker_container_exec - 添加
detach
参数(https://github.com/ansible-collections/community.docker/issues/250,https://github.com/ansible-collections/community.docker/pull/255)。docker_container_exec - 添加
env
选项(https://github.com/ansible-collections/community.docker/issues/248,https://github.com/ansible-collections/community.docker/pull/254)。
Bug 修复
各种模块和插件 - 如果可用,请使用 ansible-core 2.12 中包含的
distutils.version
的捆绑版本。这避免了当distutils
从 Python 3.12 的标准库中删除时出现中断。请注意,ansible-core 2.11、ansible-base 2.10 和 Ansible 2.9 目前与 Python 3.12 不兼容,因此此修复不针对这些 ansible-core/-base/2.9 版本(https://github.com/ansible-collections/community.docker/pull/258)。docker 连接插件 - 将已弃用的
distutils.spawn.find_executable
替换为 Ansible 的get_bin_path
,以查找docker
可执行文件(https://github.com/ansible-collections/community.docker/pull/257)。docker_container_exec - 禁止对 1.35 之前的 Docker API 使用
chdir
选项(https://github.com/ansible-collections/community.docker/pull/253)。
v2.0.2
版本概要
Bug 修复版本。
Bug 修复
docker_api 连接插件 - 避免将不必要的参数传递给仅由 3.0.0 或更高版本支持的 Docker SDK for Python 调用(https://github.com/ansible-collections/community.docker/pull/243)。
docker_container_exec -
chdir
仅在 Docker SDK for Python 3.0.0 及更高版本中支持。确保仅当安装了 3.0.0 或更高版本时才能使用此选项,并防止在未向此模块提供chdir
时传递此参数(https://github.com/ansible-collections/community.docker/pull/243,https://github.com/ansible-collections/community.docker/issues/242)。nsenter 连接插件 - 确保在
_connect
而不是__init__
中检索nsenter_pid
选项,以防止由于错误的初始化顺序而导致的崩溃(https://github.com/ansible-collections/community.docker/pull/249)。nsenter 连接插件 - 将
--all-namespaces
的使用替换为特定命名空间,以支持与 Busybox nsenter 的兼容性(例如,在 Alpine 容器上使用)(https://github.com/ansible-collections/community.docker/pull/249)。
v2.0.1
版本概要
维护版本,包含一些文档修复。
v2.0.0
版本概要
新的主要版本,删除了一些弃用项,并在 docker_compose
模块中对 timeout
参数进行了重大更改。
重大更改/移植指南
docker_compose - 修复
timeout
的默认行为,以便如果 compose 文件中定义了stop_grace_period
,则在未指定timeout
的情况下使用它(https://github.com/ansible-collections/community.docker/pull/163)。
已弃用的功能
docker_container - 已弃用在
published_ports
中使用特殊值all
。请改用publish_all_ports=true
(https://github.com/ansible-collections/community.docker/pull/210)。
已删除的功能(先前已弃用)
docker_container -
container_default_behavior
的默认值更改为no_defaults
(https://github.com/ansible-collections/community.docker/pull/210)。docker_container - 如果指定了
networks
且networks_cli_compatible=true
,则network_mode
的默认值现在是networks
中指定的第一个网络的名称(https://github.com/ansible-collections/community.docker/pull/210)。docker_container -
all
特殊值不能再与published_ports
中的其他值一起使用。 请改用publish_all_ports=true
(https://github.com/ansible-collections/community.docker/pull/210)。docker_login - 删除
email
选项(https://github.com/ansible-collections/community.docker/pull/210)。
v1.10.0
版本概要
定期功能和错误修复版本。
小的改动
将模块 docker_container_exec、docker_image_load 和 docker_plugin 添加到
docker
模块的默认组中 (https://github.com/ansible-collections/community.docker/pull/209)。docker_config - 添加选项
data_src
以从目标读取配置数据 (https://github.com/ansible-collections/community.docker/issues/64, https://github.com/ansible-collections/community.docker/pull/203)。docker_secret - 添加选项
data_src
以从目标读取 secret 数据 (https://github.com/ansible-collections/community.docker/issues/64, https://github.com/ansible-collections/community.docker/pull/203)。
v1.9.1
发布摘要
常规错误修复版本。
错误修复
docker_compose - 修复了当定义了
profiles
但未启用任何 profile 时,服务不正确的changed
状态 (https://github.com/ansible-collections/community.docker/pull/192)。
v1.9.0
发布摘要
新的错误修复和功能发布。
次要更改
docker_* 模块 - 在报告找不到 Python 的 Docker SDK 时,包含
ImportError
回溯 (https://github.com/ansible-collections/community.docker/pull/188)。docker_compose - 添加了
env_file
选项,用于指定自定义环境变量文件 (https://github.com/ansible-collections/community.docker/pull/174)。docker_container - 添加了
publish_all_ports
选项,用于将所有暴露的端口发布到随机端口,但使用published_ports
显式绑定的端口除外 (这已经在 community.docker 1.8.0 中添加) (https://github.com/ansible-collections/community.docker/pull/162)。docker_container - 添加了新的
command_handling
选项,其当前的已弃用默认值为compatibility
,该选项允许控制模块在解释列表时如何处理 shell 引号,以及模块如何处理空列表/字符串。默认值将在 community.docker 3.0.0 中切换为correct
(https://github.com/ansible-collections/community.docker/pull/186)。docker_container - 取消了使用
mounts
选项创建匿名卷的限制 (https://github.com/ansible-collections/community.docker/pull/181)。
已弃用功能
docker_container - 新的
command_handling
的默认值compatibility
已弃用,将在 community.docker 3.0.0 中更改为correct
。如果行为将发生更改,该模块将发出弃用警告。请注意,ansible-core 将仅输出一次弃用警告,因此如果较早的任务显示该警告,则可能有更多任务带有此警告,但未显示 (https://github.com/ansible-collections/community.docker/pull/186)。
错误修复
docker_compose - 修复了在使用
docker-compose <1.17.0
时启动服务时任务失败的问题 (https://github.com/ansible-collections/community.docker/issues/180)。docker_container - 确保当状态代码为非零时,在
detached=false
时也返回container
(https://github.com/ansible-collections/community.docker/pull/178)。docker_stack_info - 确保在检查模式下不跳过模块 (https://github.com/ansible-collections/community.docker/pull/183)。
docker_stack_task_info - 确保在检查模式下不跳过模块 (https://github.com/ansible-collections/community.docker/pull/183)。
新插件
连接
community.docker.nsenter - 在运行控制器容器的主机上执行
v1.8.0
发布摘要
常规错误修复和功能发布。
次要更改
避免使用内部 ansible-core module_utils,而使用自 Ansible 2.9 起可用的等效公共 API (https://github.com/ansible-collections/community.docker/pull/164)。
docker_compose - 添加了
profiles
选项,用于在启动服务时指定服务配置文件 (https://github.com/ansible-collections/community.docker/pull/167)。docker_containers 清单插件 - 当
connection_type=docker-api
时,现在将 Docker 守护程序连接选项从清单插件传递到连接插件。可以通过设置configure_docker_daemon=false
来禁用此功能 (https://github.com/ansible-collections/community.docker/pull/157)。docker_host_info - 允许将
containers_filters
、images_filters
、networks_filters
和volumes_filters
中的键的值作为 YAML 列表传递 (https://github.com/ansible-collections/community.docker/pull/160)。docker_plugin - 添加了
alias
选项,用于指定 docker 插件的本地名称 (https://github.com/ansible-collections/community.docker/pull/161)。
错误修复
docker_compose - 修复了使用
stopped: true
时的幂等性错误 (https://github.com/ansible-collections/community.docker/issues/142, https://github.com/ansible-collections/community.docker/pull/159)。
v1.7.0
发布摘要
小型功能和错误修复版本。
次要更改
docker_image - 允许按 ID 标记镜像 (https://github.com/ansible-collections/community.docker/pull/149)。
v1.6.1
发布摘要
错误修复版本,以减少弃用警告的垃圾信息。
错误修复
docker_* 模块和插件,除了
docker_swarm
连接插件以及docker_compose
和docker_stack*` 模块 - 仅当实际使用 TLS 时才发出 ``tls_hostname
弃用消息 (https://github.com/ansible-collections/community.docker/pull/143)。
v1.6.0
发布摘要
常规错误修复和功能发布。
次要更改
通用模块实用程序 - 更正错误消息,以指导安装正确的 Python Docker SDK 模块 (https://github.com/ansible-collections/community.docker/pull/125)。
docker_container - 允许
memory_swap: -1
将内存交换限制设置为无限制。当用户由于 cgroup 限制或其他原因无法设置内存交换限制时,这非常有用,因为默认情况下 Docker 将尝试将交换使用量设置为memory
值的两倍 (https://github.com/ansible-collections/community.docker/pull/138)。
已弃用功能
除了
docker_swarm
连接插件以及docker_compose
和docker_stack*` 模块
之外的所有 docker_* 模块和插件 -tls_hostname
的当前默认值localhost
已被弃用。在 community.docker 2.0.0 中,它将改为从docker_host
计算得出 (https://github.com/ansible-collections/community.docker/pull/134)。
Bugfixes
docker-compose - 修复当
state: present
和stopped: true
时不拉取的问题 (https://github.com/ansible-collections/community.docker/issues/12, https://github.com/ansible-collections/community.docker/pull/119)。docker_plugin - 在安装后也配置插件 (https://github.com/ansible-collections/community.docker/issues/118, https://github.com/ansible-collections/community.docker/pull/135)。
docker_swarm_services - 如果未指定
published_port
,则避免在幂等性检查期间崩溃 (https://github.com/ansible-collections/community.docker/issues/107, https://github.com/ansible-collections/community.docker/pull/136)。
v1.5.0
发布摘要
定期功能版本。
次要更改
向大多数 docker 模块和插件添加
use_ssh_client
选项 (https://github.com/ansible-collections/community.docker/issues/108, https://github.com/ansible-collections/community.docker/pull/114)。
Bugfixes
所有模块 - 使用
to_native
将异常转换为字符串 (https://github.com/ansible-collections/community.docker/pull/121)。
新模块
community.docker.docker_container_exec - 在 docker 容器中执行命令
v1.4.0
发布摘要
安全版本,用于解决另一个潜在的秘密泄漏问题。还包括常规的错误修复和功能。
次要更改
docker_swarm_service - 将
publish.published_port
选项从强制改为可选。如果未指定,Docker 将分配随机高端口 (https://github.com/ansible-collections/community.docker/issues/99)。
重大更改 / 移植指南
docker_swarm - 如果指定了
join_token
,则返回的具有相同值的加入令牌将被VALUE_SPECIFIED_IN_NO_LOG_PARAMETER
替换。请确保当使用指定的join_token
调用模块时,不要盲目使用此模块返回值中的加入令牌!此重大更改出现在次要版本中,因为它对于修复安全问题是必要的 (https://github.com/ansible-collections/community.docker/pull/103)。
安全修复
docker_swarm -
join_token
选项现在标记为no_log
,因此不再写入日志 (https://github.com/ansible-collections/community.docker/pull/103)。
Bugfixes
docker_swarm_service
- 修复由引用已弃用的选项update_failure_action
引起的 KeyError (https://github.com/ansible-collections/community.docker/pull/100)。docker_swarm_service - 将
secrets
模块选项标记为no_log=False
,因为它不会泄漏秘密 (https://github.com/ansible-collections/community.general/pull/2001)。
v1.3.0
发布摘要
定期功能和错误修复版本。
次要更改
docker_container - 添加
storage_opts
选项以指定存储选项 (https://github.com/ansible-collections/community.docker/issues/91, https://github.com/ansible-collections/community.docker/pull/93)。docker_image - 允许使用新选项
pull_platform
为source=pull
指定要拉取的平台 (https://github.com/ansible-collections/community.docker/issues/79, https://github.com/ansible-collections/community.docker/pull/89)。docker_image - 正确支持用于加载和标记映像的映像 ID(哈希值)(https://github.com/ansible-collections/community.docker/issues/86, https://github.com/ansible-collections/community.docker/pull/87)。
docker_swarm_service - 在复制模式下运行 swarm 服务时,添加对每个节点的最大任务数 (
replicas_max_per_node
) 的支持。在 API 1.40 中引入 (https://github.com/ansible-collections/community.docker/issues/7, https://github.com/ansible-collections/community.docker/pull/92)。
Bugfixes
docker_container - 修复使用严格比较的健康检查禁用幂等性问题 (https://github.com/ansible-collections/community.docker/issues/85)。
docker_image - 防止在检查和删除之间删除的映像时模块失败 (https://github.com/ansible-collections/community.docker/pull/87)。
docker_image - 防止在按 ID 删除不存在的映像时模块失败 (https://github.com/ansible-collections/community.docker/pull/87)。
docker_image_info - 防止在列表和检查之间映像消失时模块失败 (https://github.com/ansible-collections/community.docker/pull/87)。
docker_image_info - 防止在按 ID 查询不存在的映像时模块失败 (https://github.com/ansible-collections/community.docker/pull/87)。
新模块
community.docker.docker_image_load - 从存档加载 docker 映像
community.docker.docker_plugin - 管理 Docker 插件
v1.2.2
发布摘要
用于解决 CVE-2021-20191 的安全错误修复版本。
安全修复
docker_swarm - 为选项
signing_ca_key
启用no_log
,以防止意外泄露(CVE-2021-20191, https://github.com/ansible-collections/community.docker/pull/80)。
v1.2.1
发布摘要
Bug 修复版本。
Bugfixes
docker 连接插件 - 修复 Docker 版本解析,因为某些 docker 版本在命令
docker version --format "{{.Server.Version}}"
的输出中具有前导v
(https://github.com/ansible-collections/community.docker/pull/76)。
v1.2.0
发布摘要
具有一个新功能和两个错误修复的功能版本。
次要更改
docker_container - 添加了
default_host_ip
选项,该选项允许显式设置未明确指定 IP 的已发布端口的默认 IP 字符串。当使用 Docker 20.10.2 或更新版本进行 IPv6 绑定时,需要将其设置为空字符串 (""
) (https://github.com/ansible-collections/community.docker/issues/70, https://github.com/ansible-collections/community.docker/pull/71)。
Bugfixes
docker_container - 允许在绑定 IP 中使用 IPv6 区域 (RFC 4007) (https://github.com/ansible-collections/community.docker/pull/66)。
docker_image - 修复了在使用早于 2.5.0 的 Python 版 Docker SDK 加载镜像时发生的崩溃问题 (https://github.com/ansible-collections/community.docker/issues/72, https://github.com/ansible-collections/community.docker/pull/73)。
v1.1.0
发布摘要
此功能版本包含三个新的插件和模块。
次要更改
docker_container - 支持指定
cgroup_parent
(https://github.com/ansible-collections/community.docker/issues/6, https://github.com/ansible-collections/community.docker/pull/59)。docker_container - 当容器以
detached=false
启动时,即使status
为 0 现在也会返回 (https://github.com/ansible-collections/community.docker/issues/26, https://github.com/ansible-collections/community.docker/pull/58)。docker_image - 在构建镜像时支持
platform
(https://github.com/ansible-collections/community.docker/issues/22, https://github.com/ansible-collections/community.docker/pull/54)。
已弃用功能
docker_container - 当前,
published_ports
可以包含端口映射,以及特殊值all
,在这种情况下,端口映射将被忽略。此行为在 community.docker 2.0.0 中已被弃用,届时它将被禁止,或者此行为将以类似于 Docker CLI 工具处理此问题的方式正确实现 (https://github.com/ansible-collections/community.docker/issues/8, https://github.com/ansible-collections/community.docker/pull/60)。
Bugfixes
docker_image - 如果将
push=true
与repository
一起使用,并且镜像不需要标记,则仍然推送。如果repository
和name
相等,则可能会发生这种情况 (https://github.com/ansible-collections/community.docker/issues/52, https://github.com/ansible-collections/community.docker/pull/53)。docker_image - 当加载不包含任何镜像的损坏的归档文件时报告错误 (https://github.com/ansible-collections/community.docker/issues/46, https://github.com/ansible-collections/community.docker/pull/55)。
docker_image - 当加载的归档文件不包含指定的镜像时报告错误 (https://github.com/ansible-collections/community.docker/issues/41, https://github.com/ansible-collections/community.docker/pull/55)。
新插件
连接
community.docker.docker_api - 在 docker 容器中运行任务
清单
community.docker.docker_containers - 用于 Docker 容器的 Ansible 动态清单插件。
新模块
community.docker.current_container_facts - 返回有关模块是否在 Docker 容器中运行的事实
v1.0.1
发布摘要
维护版本,修复了 docker_container
的一个错误。
Bugfixes
docker_container -
device_requests
中capabilities
的验证不正确 (https://github.com/ansible-collections/community.docker/issues/42, https://github.com/ansible-collections/community.docker/pull/43)。
v1.0.0
发布摘要
这是 community.docker
的第一个生产(非预发布)版本。
次要更改
添加
docker
操作组/模块默认组的集合端支持 (https://github.com/ansible-collections/community.docker/pull/17)。docker_image - 返回 docker 构建输出 (https://github.com/ansible-collections/community.general/pull/805)。
docker_secret - 当密钥没有
ansible_key
标签但未设置force
参数时,添加警告 (https://github.com/ansible-collections/community.docker/issues/30, https://github.com/ansible-collections/community.docker/pull/31)。
v0.1.0
发布摘要
community.docker
在 community.general
1.2.0 中的状态下继续对 Ansible docker 模块和插件进行工作。此处列出的更改是相对于模块和插件 community.general.docker*
而言的。
已应用计划用于 community.general
2.0.0 的所有弃用删除。计划用于 community.general
3.0.0 的所有弃用删除已重新安排在 community.docker
2.0.0 中。
次要更改
docker_container - 现在支持
device_requests
选项,该选项允许请求额外的资源,如 GPU (https://github.com/ansible/ansible/issues/65748, https://github.com/ansible-collections/community.general/pull/1119)。
已删除功能(先前已弃用)
docker_container - 不再返回
ansible_facts
(https://github.com/ansible-collections/community.docker/pull/1)。docker_container -
networks_cli_compatible
的默认值已更改为true
(https://github.com/ansible-collections/community.docker/pull/1)。docker_container - 已删除未使用的选项
trust_image_content
(https://github.com/ansible-collections/community.docker/pull/1)。docker_image - 已删除
state=build
。请改用present
(https://github.com/ansible-collections/community.docker/pull/1)。docker_image -
container_limits
,dockerfile
,http_timeout
,nocache
,rm
,path
,buildargs
,pull
这些选项已被移除。请改用build
的相应子选项 (https://github.com/ansible-collections/community.docker/pull/1)。docker_image -
force
选项已被移除。请改用更具体的force_*
选项 (https://github.com/ansible-collections/community.docker/pull/1)。docker_image -
source
选项现在是必需的 (https://github.com/ansible-collections/community.docker/pull/1)。docker_image -
use_tls
选项已被移除。请改用tls
和validate_certs
选项 (https://github.com/ansible-collections/community.docker/pull/1)。docker_image -
build.pull
选项的默认值已更改为false
(https://github.com/ansible-collections/community.docker/pull/1)。docker_image_facts - 此别名不再可用,请改用
docker_image_info
(https://github.com/ansible-collections/community.docker/pull/1)。docker_network - 不再返回
ansible_facts
(https://github.com/ansible-collections/community.docker/pull/1)。docker_network -
ipam_options
选项已被移除。请改用ipam_config
(https://github.com/ansible-collections/community.docker/pull/1)。docker_service - 不再返回
ansible_facts
(https://github.com/ansible-collections/community.docker/pull/1)。docker_swarm -
state=inspect
已被移除。请改用docker_swarm_info
(https://github.com/ansible-collections/community.docker/pull/1)。docker_swarm_service -
constraints
选项已被移除。请改用placement.constraints
(https://github.com/ansible-collections/community.docker/pull/1)。docker_swarm_service -
limit_cpu
和limit_memory
选项已被移除。请改用limits
中的相应子选项 (https://github.com/ansible-collections/community.docker/pull/1)。docker_swarm_service -
log_driver
和log_driver_options
选项已被移除。请改用logging
中的相应子选项 (https://github.com/ansible-collections/community.docker/pull/1)。docker_swarm_service -
reserve_cpu
和reserve_memory
选项已被移除。请改用reservations
中的相应子选项 (https://github.com/ansible-collections/community.docker/pull/1)。docker_swarm_service -
restart_policy
,restart_policy_attempts
,restart_policy_delay
和restart_policy_window
选项已被移除。请改用restart_config
中的相应子选项 (https://github.com/ansible-collections/community.docker/pull/1)。docker_swarm_service -
update_delay
,update_parallelism
,update_failure_action
,update_monitor
,update_max_failure_ratio
和update_order
选项已被移除。请改用update_config
中的相应子选项 (https://github.com/ansible-collections/community.docker/pull/1)。docker_volume - 不再返回
ansible_facts
(https://github.com/ansible-collections/community.docker/pull/1)。docker_volume -
force
选项已被移除。请改用recreate
(https://github.com/ansible-collections/community.docker/pull/1)。
Bugfixes
docker_login - 修复了内部配置文件存储,以处理多个注册表的凭据 (https://github.com/ansible-collections/community.general/issues/1117)。