服务“侦听器”构建失败:docker compose

时间:2018-08-06 18:01:38

标签: docker docker-compose docker-swarm

我正在尝试撰写此.yml文件

services:
  cedr_manager:
    container_name: cedr
    build:
      context: ./cedr_manager
      args:
        api_port: 8001
        project_domain_id: default
        user_domain_id: default
        openstack_user: demo
        openstack_pass: secret
        auth_url: "http://10.0.2.15/identity"
        openstack_tenant: admin
        kibana_url: "http://10.20.0.3:80"
        elasticsearch_url: "http://10.20.0.3:9200"
        http_proxy: ""
        https_proxy: ""
    volumes:
      - /mnt/cedr_db:/mnt/cedr_db
    ports:
      - "8001:8001"
    # this adds to /etc/hosts
    extra_hosts:
      - "pv:192.168.101.8"
  listener:
    container_name: listener
    build:
      context: ./listener
      args:
        host: 10.0.2.15
        port: 5672
        cedr_host: 10.0.2.15
        username: stackrabbit
        password: c7d4cfa3a3881a1a9c43
        http_proxy: "http://10.0.2.15"
        https_proxy: "https://10.0.2.15"

它抛出了一个我无法解决的错误。我更新了我的python和pip,但仍然抛出相同的结果。任何帮助将不胜感激。

错误看起来像这样

获取http://dl- cdn.alpinelinux.org/alpine/v3.5/main/x86_64/APKINDEX.tar.gz 错误:http://dl-cdn.alpinelinux.org/alpine/v3.5/main:DNS查找 错误 警告:忽略APKINDEX.c51f8f92.tar.gz:无此类文件或 目录 提取http://dl- cdn.alpinelinux.org/alpine/v3.5/community/x86_64/APKINDEX.tar.gz 错误:http://dl-cdn.alpinelinux.org/alpine/v3.5/community:DNS 查找错误 警告:忽略APKINDEX.d09172fd.tar.gz:无此类文件或 目录 错误:约束无法满足: 构建基础(缺失): 所需者:world [build-base] linux-headers(丢失): 所需者:world [linux-headers] py-pip(丢失): 要求:world [py-pip] python(缺少): 所需者:world [python] python-dev(缺少): 所需者:world [python-dev] 错误:服务“侦听器”生成失败:命令“ / bin / sh -c apk add --update python python-dev py-pip构建基础
linux-headers'返回了一个非零代码:5

The Docker File looks like this

FROM alpine:3.5
MAINTAINER Mirantis admin@mirantis.com

ARG http_proxy=""
ARG https_proxy=""
ARG host=192.168.0.3
ARG port=5673
ARG cedr_host=10.20.0.3
ARG username=nova
ARG password=8eLqY7li

#set proxy
ENV http_proxy $http_proxy https_proxy $https_proxy

RUN apk add --update \
    python \
    python-dev \
    py-pip \
    build-base \
    linux-headers

ADD . /listener_code
WORKDIR /listener_code
RUN pip install -r requirements.txt
RUN sed -i -e "s/\${host}/$host/g" -e "s/\${port}/$port/g" -e "s/\${username}/$username/g" \
    -e "s/\${password}/$password/g" -e "s/\${cedr_host}/$cedr_host/g" listener.conf

# unset proxy
ENV http_proxy="" https_proxy=""
CMD python notify.py --config listener.conf

0 个答案:

没有答案