【问题标题】:not able to pull ansible image无法提取 ansible 图像
【发布时间】:2022-01-17 22:13:08
【问题描述】:

我正在尝试提取 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官方图片,但是没有官方图片?

【问题讨论】:

标签: docker ansible


【解决方案1】:

从基础 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

【讨论】:

    【解决方案2】:

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

    然后拉出所需的标签。此图像没有可用的最新标签。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-17
      • 2020-08-07
      • 1970-01-01
      • 1970-01-01
      • 2017-05-14
      • 2018-09-05
      • 2018-11-29
      相关资源
      最近更新 更多