FROM centos:7
RUN yum check-update; \
yum install -y gcc libffi-devel python3 epel-release; \
yum install -y python3-pip; \
yum install -y wget; \
yum clean all
RUN pip3 install --upgrade pip; \
pip3 install "ansible"; \
wget -q https://raw.githubusercontent.com/ansible-collections/azure/dev/requirements-azure.txt; \
pip3 install -r requirements-azure.txt; \
rm requirements-azure.txt; \
ansible-galaxy collection install azure.azcollection
pip3 install "pywinrm>=0.2.2"
WORKDIR /product
CMD [ "/usr/sbin/init" ]pip3 install "pywinrm>=0.2.2",WORKDIR /product,CMD [ "/usr/sbin/init" ]Compose Up选项version: '2'
services:
ansible:
container_name: ansible
hostname: ansible
image: ansible
build:
context: .
dockerfile: Dockerfile
volumes:
- ../../../../../../../:/product
dns:
- 200.0.10.100#6 187.2 ERROR! Neither the collection requirement entry key 'name', nor 'source' point to a concrete resolvable collection artifact. Also 'name' is not an FQCN. A valid collection name must be in the format <namespace>.<collection>. Please make sure that the namespace and the collection name contain characters from [a-zA-Z0-9_] only.
#6 187.2
#6 187.2 Could not find pip3.
------
executor failed running [/bin/sh -c yum install -y python3-pip; pip3 install --upgrade pip; pip3 install "ansible"; wget -q https://raw.githubusercontent.com/ansible-collections/azure/dev/requirements-azure.txt; pip3 install -r requirements-azure.txt; rm requirements-azure.txt; ansible-galaxy collection install azure.azcollection pip3 install "pywinrm>=0.2.2"]: exit code: 1
ERROR: Service 'ansible' failed to build : Build failed
The terminal process "C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command docker-compose -f "images\local\ansible\v210\docker-compose.yml" up -d --build" terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.RUN命令根本没有执行docker build .和docker-compose up命令--创建容器失败那么,缺少什么或者我需要修复什么才能工作呢?
发布于 2021-07-13 20:07:45
您的Dockerfile中有一个错误。RUN命令中的两行不能用; \或&& \分隔。
ansible-galaxy collection install azure.azcollection; \
pip3 install "pywinrm>=0.2.2"因此,这个错误由ansible-galaxy命令返回,该命令试图对pip3执行一些操作。
https://serverfault.com/questions/1069065
复制相似问题