docker-compose返回非零代码:100

时间:2016-12-11 20:41:37

标签: docker docker-compose docker-machine

我正在尝试使用docker但是当我尝试运行docker-compose build时遇到此错误我收到此错误。这是DNS问题吗?我试过设置

sudo docker-compose build的输出:

Building php
Step 1 : FROM pvlltvk/ubuntu-trusty-php-fpm-5.6
 ---> d48912228ec2
Step 2 : RUN apt-get install -y     php5-curl     php5-sybase     freetds-dev     libxml2-dev
 ---> Running in 0c614dc10ae3
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  ca-certificates freetds-common libct4 libcurl3 libidn11 librtmp0 libsybdb5
  openssl
Suggested packages:
  pkg-config
The following NEW packages will be installed:
  ca-certificates freetds-common freetds-dev libct4 libcurl3 libidn11 librtmp0
  libsybdb5 libxml2-dev openssl php5-curl php5-sybase
0 upgraded, 12 newly installed, 0 to remove and 3 not upgraded.
Need to get 2752 kB of archives.
After this operation, 8659 kB of additional disk space will be used.
Err http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu/ trusty/main openssl amd64 1.0.2h-1+deb.sury.org~trusty+1
  404  Not Found
Get:1 http://archive.ubuntu.com/ubuntu/ trusty/main libidn11 amd64 1.28-1ubuntu2 [93.0 kB]
Err http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu/ trusty/main php5-curl amd64 5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1
  404  Not Found
Err http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu/ trusty/main php5-sybase amd64 5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1
  404  Not Found
Get:2 http://archive.ubuntu.com/ubuntu/ trusty/main librtmp0 amd64 2.4+20121230.gitdf6c518-1 [57.5 kB]
Get:3 http://archive.ubuntu.com/ubuntu/ trusty/main freetds-common all 0.91-5 [24.3 kB]
Get:4 http://archive.ubuntu.com/ubuntu/ trusty/main libct4 amd64 0.91-5 [166 kB]
Get:5 http://archive.ubuntu.com/ubuntu/ trusty/main libcurl3 amd64 7.35.0-1ubuntu2 [172 kB]
Get:6 http://archive.ubuntu.com/ubuntu/ trusty/main libsybdb5 amd64 0.91-5 [194 kB]
Get:7 http://archive.ubuntu.com/ubuntu/ trusty/main ca-certificates all 20130906ubuntu2 [175 kB]
Get:8 http://archive.ubuntu.com/ubuntu/ trusty/main freetds-dev amd64 0.91-5 [514 kB]
Get:9 http://archive.ubuntu.com/ubuntu/ trusty/main libxml2-dev amd64 2.9.1+dfsg1-3ubuntu4 [628 kB]
Fetched 2023 kB in 34s (58.1 kB/s)
E: Failed to fetch http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu/pool/main/o/openssl/openssl_1.0.2h-1+deb.sury.org~trusty+1_amd64.deb  404  Not Found

E: Failed to fetch http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu/pool/main/p/php5/php5-curl_5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1_amd64.deb  404  Not Found

E: Failed to fetch http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu/pool/main/p/php5/php5-sybase_5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1_amd64.deb  404  Not Found

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
ERROR: Service 'php' failed to build: The command '/bin/sh -c apt-get install -y     php5-curl     php5-sybase     freetds-dev     libxml2-dev' returned a non-zero code: 100

这是泊坞文件:

FROM pvlltvk/ubuntu-trusty-php-fpm-5.6

RUN apt-get install -y \
    php5-curl \
    php5-sybase \
    freetds-dev \
    libxml2-dev

ADD freetds.conf /etc/freetds/freetds.conf

RUN echo 'alias sf="php /app/app/console"' >> ~/.bashrc

WORKDIR /app

如果我运行sudo cat / etc / default / docker:

DOCKER_OPTS="-dns 8.8.8.8 -dns 8.8.4.4"

1 个答案:

答案 0 :(得分:1)

Docker镜像不包含软件包存储库缓存,它们占用磁盘空间并且很快就会过时。看起来您正在从包含陈旧存储库缓存的映像构建。更改运行命令以提取当前存储库状态,以非交互方式运行,并在完成时进行清理:

RUN apt-get update \
 && DEBIAN_FRONTEND=noninteractive apt-get install -y \
    php5-curl \
    php5-sybase \
    freetds-dev \
    libxml2-dev \
 && apt-get clean \
 && rm -rf /var/lib/apt/lists/*

有关详细信息,请参阅best practices