无法拉出ansible图像

not able to pull ansible image

我正在尝试拉取 ansible 图像,我在 hub.docker.com 上搜索,我找到了 4 年前更新的图像 https://hub.docker.com/r/ansible/ansible

当我试图拉动它时,它不起作用。

$ docker pull ansible/ansible
Using default tag: latest
Error response from daemon: manifest for ansible/ansible:latest not found: manifest unknown: manifest unknown

我也会检查是否有任何网络问题,但我可以下载 alpine 图片。

$ docker image pull alpine
Using default tag: latest
latest: Pulling from library/alpine
59bf1c3509f3: Pull complete
Digest: sha256:21a3deaa0d32a8057914f36584b5288d2e5ecc984380bc0118285c70fa8c9300
Status: Downloaded newer image for alpine:latest
docker.io/library/alpine:latest

表示有效 :D .

我也在找ansible官方镜像,但是没有官方镜像?

从基础 python 映像构建您自己的映像只需不到 5 分钟,让您可以绝对和完全控制要使用的 python 版本,可选的 python 要安装的包,要使用的 ansible 的确切版本,要安装的可选集合...

下面的示例 Dockerfile 在最新可用的 python 版本中安装最新版本的基础 ansible。适应自己的需求。

FROM python:latest

RUN pip install ansible

CMD bash

从您创建该文件的目录 运行

docker build -t ansible:mytag .

那就尽情享受吧

$ docker run -it --rm --name ansible_test_container ansible:mytag 
root@a4ec5c718267:/# ansible --version
ansible [core 2.12.1]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.10/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.10.1 (main, Dec  8 2021, 03:30:49) [GCC 10.2.1 20210110]
  jinja version = 3.0.3
  libyaml = True
root@a4ec5c718267:/# exit
exit

检查标签 https://hub.docker.com/r/ansible/ansible/tags

并拉取所需的标签。此图片没有可用的最新标签。