Docker图像似乎缺少图层

时间:2016-08-26 13:27:26

标签: macos docker

我在使用docker构建时遇到了一些明显的奇怪行为,导致图像丢失了一些二进制文件。几乎看起来图像中实际上缺少某些图层。

因此,层次结构是:

java:8
  |
  -> localhost:5000/php-cli-wiremock
     |
     -> localhost:5000/php-cli-wiremock-postgres

从“php-cli-wiremock”运行的容器有所有预期的二进制文件(java,php-cli,wiremock)

从“php-cli-wiremock-postgres”运行的容器只有(php-cli,wiremock,postgres)。即他们缺少/ usr / bin / java。几乎看起来好像删除了java:8图层,但它们出现在docker history中,如下所示。

我确信这些二进制文件不会在“php-cli-wiremock-postgres”版本的任何步骤中删除。

构建图像

**“java:8”Dockerfile:**

https://github.com/docker-library/openjdk/blob/baaaf7714f9c66e4c5decf2c108a2738b7186c7f/8-jre/Dockerfile

“php-cli-wiremock”Dockerfile

# combination of wiremock and php-cli. Combination is necessary to allow use with shippable.com
FROM java:8


# ----- wiremock ----
ENV WM_PKG_NAME wiremock
ENV WM_VERSION 1.57

# ----- php-cli ----
ENV PHP_VERSION 5.6.24
ENV PHP_INI_DIR /usr/local/etc/php
ENV PHP_BUILD_DEPS bzip2 \
        file \
        libbz2-dev \
        libcurl4-openssl-dev \
        libjpeg-dev \
        libmcrypt-dev \
        libpng12-dev \
        libreadline6-dev \
        libssl-dev \
        libxslt1-dev \
        libxml2-dev \
        libreadline-dev \
        libncursesw5-dev \
        libnewt-dev


# ----- wiremock ----
RUN \
  cd / && \
  wget https://repo1.maven.org/maven2/com/github/tomakehurst/wiremock/$WM_VERSION/$WM_PKG_NAME-$WM_VERSION-standalone.jar && \
  mkdir /$WM_PKG_NAME && mv $WM_PKG_NAME-$WM_VERSION-standalone.jar /$WM_PKG_NAME/$WM_PKG_NAME.jar

# ----- php-cli ----
RUN apt-get update && apt-get install -y ca-certificates curl libxml2 autoconf \
    gcc libc-dev make pkg-config nano less tmux wget git postgresql libpq-dev \
    $PHP_BUILD_DEPS $PHP_EXTRA_BUILD_DEPS \
    --no-install-recommends && rm -r /var/lib/apt/lists/*

RUN gpg --keyserver pool.sks-keyservers.net --recv-keys 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3 0BD78B5F97500D450838F95DFE857D9A90D90EC1 \
    && mkdir -p $PHP_INI_DIR/conf.d \
    && set -x \
    && curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2 \
    && curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2.asc/from/this/mirror" -o php.tar.bz2.asc \
    && gpg --verify php.tar.bz2.asc \
    && mkdir -p /usr/src/php \
    && tar -xof php.tar.bz2 -C /usr/src/php --strip-components=1 \
    && rm php.tar.bz2* \
    && cd /usr/src/php \
    && ./configure \
        --with-pdo-pgsql=/Applications/Postgres.app/Contents/Versions/9.5/bin \
        --with-config-file-path="$PHP_INI_DIR" \
        --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
        $PHP_EXTRA_CONFIGURE_ARGS \
        --disable-cgi \
        --enable-bcmath \
        --with-bz2 \
        --enable-calendar \
        --with-curl \
        --with-gd \
        --with-jpeg-dir \
        --enable-gd-native-ttf \
        --enable-mbstring \
        --with-mcrypt \
        --enable-pcntl \
        --with-openssl \
        --with-xsl \
        --with-readline \
        --with-zlib \
        --enable-zip \
        --with-newt \
    && make -j"$(nproc)" \
    && make install \
    && { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \
    && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false $buildDeps \
    && make clean \
    && pecl install ncurses \
    && pecl install newt \
    && cd /opt \
    && curl -sS https://getcomposer.org/installer | php \
    && ln -s /opt/composer.phar /usr/local/bin/composer \
    && wget https://phar.phpunit.de/phpunit.phar \
    && chmod +x phpunit.phar \
    && mv phpunit.phar /usr/local/bin/phpunit

RUN groupadd -r app -g 433 && \
    mkdir /home/app && \
    useradd -u 431 -r -g app -d /home/app -s /bin/sh -c "Default application account" app && \
    chown -R app:app /home/app && \
    chmod 711 /home/app


# ----- shippable.com ----
RUN apt-get update && apt-get -qq -y install curl lsb-release && \
    echo $(lsb_release -c -s) && \
    export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" && \
    echo $CLOUD_SDK_REPO && \
#    export CLOUD_SDK_REPO="cloud-sdk-jessie" && \
    echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | tee /etc/apt/sources.list.d/google-cloud-sdk.list && \
    curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - && \
    apt-get update && \
    apt-get -qq -y install google-cloud-sdk

# ----- php-cli ----
COPY files /
ADD php.ini /usr/local/etc/php/php.ini
COPY ./docker-entrypoint.sh /


# ----- wiremock ----
COPY wiremockCacheFiles/__files /wiremock/__files
COPY wiremockCacheFiles/mappings /wiremock/mappings
#VOLUME ["/wiremock/__files", "/wiremock/mappings"]

#WORKDIR /opt/app

# Define default command.
ENTRYPOINT ["/docker-entrypoint.sh"]
#ENTRYPOINT exec java -jar wiremock.jar

# ENTRYPOINT pwd && ls -la



# Expose ports.
#   - 8080: HTTP
EXPOSE 8080

“php-cli-wiremock-postgres”Dockerfile

# combination of wiremock and php-cli and postgres. Combination is necessary to allow use with shippable.com
FROM localhost:5000/php-cli-wiremock:latest


# explicitly set user/group IDs
#RUN groupadd -r postgres --gid=999 && useradd -r -g postgres --uid=999 postgres

# grab gosu for easy step-down from root
ENV GOSU_VERSION 1.7
RUN set -x \
    && apt-get update && apt-get install -y --no-install-recommends ca-certificates wget && rm -rf /var/lib/apt/lists/* \
    && wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \
    && wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \
    && export GNUPGHOME="$(mktemp -d)" \
    && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
    && gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
    && rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \
    && chmod +x /usr/local/bin/gosu \
    && gosu nobody true \
    && apt-get purge -y --auto-remove ca-certificates wget

# make the "en_US.UTF-8" locale so postgres will be utf-8 enabled by default
RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \
    && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
ENV LANG en_US.utf8

RUN mkdir /docker-entrypoint-initdb.d

RUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8

ENV PG_MAJOR 9.5
ENV PG_VERSION 9.5.4-1.pgdg80+1

RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list

RUN apt-get update \
    && apt-get install -y postgresql-common \
    && sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \
    && apt-get install -y \
        postgresql-$PG_MAJOR=$PG_VERSION \
        postgresql-contrib-$PG_MAJOR=$PG_VERSION \
    && rm -rf /var/lib/apt/lists/*

# make the sample config easier to munge (and "correct by default")
RUN mv -v /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample /usr/share/postgresql/ \
    && ln -sv ../postgresql.conf.sample /usr/share/postgresql/$PG_MAJOR/ \
    && sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/share/postgresql/postgresql.conf.sample

RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql

ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
ENV PGDATA /var/lib/postgresql/data
#VOLUME /var/lib/postgresql/data

#ADD postgresql.conf /var/lib/postgresql/data/postgresql
ADD postgresql.conf /postgresql.conf
COPY initdb.sh /
COPY docker-entrypoint.sh /

ENTRYPOINT ["/docker-entrypoint.sh"]

EXPOSE 5432
#CMD ["postgres"]

docker history localhost:5000/php-cli-wiremock-postgres:latest的输出:

IMAGE               CREATED             CREATED BY                                      SIZE                COMMENT
b6243b6f44fc        About an hour ago   /bin/sh -c #(nop)  EXPOSE 5432/tcp              0 B
cb7b81da3181        About an hour ago   /bin/sh -c #(nop)  ENTRYPOINT ["/docker-entry   0 B
b6b3fd7e0e82        About an hour ago   /bin/sh -c #(nop) COPY file:26fb846861d8cff95   97 B
e6cbbd72e89a        3 hours ago         /bin/sh -c #(nop) COPY file:d243227d56acbcd72   2.585 kB
5e382c77c42b        3 hours ago         /bin/sh -c #(nop) ADD file:7b8d8ca4cd55918f07   20.35 kB
863f87e01e58        13 hours ago        /bin/sh -c #(nop)  ENV PGDATA=/var/lib/postgr   0 B
82802fc4c604        13 hours ago        /bin/sh -c #(nop)  ENV PATH=/usr/lib/postgres   0 B
7e9e650a6cb7        13 hours ago        /bin/sh -c mkdir -p /var/run/postgresql && ch   0 B
abebf727dda1        13 hours ago        /bin/sh -c mv -v /usr/share/postgresql/$PG_MA   21.2 kB
34ffb57d5713        13 hours ago        /bin/sh -c apt-get update  && apt-get install   37.32 MB
1b71dfd71e40        13 hours ago        /bin/sh -c echo 'deb http://apt.postgresql.or   66 B
a1b89989f99d        13 hours ago        /bin/sh -c #(nop)  ENV PG_VERSION=9.5.4-1.pgd   0 B
2c8e74826c5b        13 hours ago        /bin/sh -c #(nop)  ENV PG_MAJOR=9.5             0 B
11d2cea562f6        13 hours ago        /bin/sh -c apt-key adv --keyserver ha.pool.sk   4.538 kB
a69a87fa5b1d        13 hours ago        /bin/sh -c mkdir /docker-entrypoint-initdb.d    0 B
ba64506ab206        13 hours ago        /bin/sh -c #(nop)  ENV LANG=en_US.utf8          0 B
0eda09bda60d        13 hours ago        /bin/sh -c apt-get update && apt-get install    1.615 MB
407fa3abad4a        13 hours ago        /bin/sh -c set -x  && apt-get update && apt-g   5.311 MB
93a992be78cd        13 hours ago        /bin/sh -c #(nop)  ENV GOSU_VERSION=1.7         0 B
c34f75bb6766        15 hours ago        /bin/sh -c #(nop)  EXPOSE 8080/tcp              0 B
52f497e39022        15 hours ago        /bin/sh -c #(nop)  ENTRYPOINT ["/docker-entry   0 B
279ea458dc03        15 hours ago        /bin/sh -c #(nop) COPY dir:06f3e18251708036e7   90.57 kB
856c03093adf        15 hours ago        /bin/sh -c #(nop) COPY dir:7cdd5a4c14b18f4563   13.43 MB
0f2ed69fb1ad        15 hours ago        /bin/sh -c #(nop) COPY file:dead660e078f1fb15   294 B
f707ffb0d62e        15 hours ago        /bin/sh -c #(nop) ADD file:0c1885686e63beacf7   72.24 kB
cac987db82a8        15 hours ago        /bin/sh -c #(nop) COPY dir:86af9edc26a678a31a   1.919 kB
b24972a0f508        15 hours ago        /bin/sh -c apt-get update && apt-get -qq -y i   89.63 MB
32be14c196e3        21 hours ago        /bin/sh -c groupadd -r app -g 433 &&  mkdir /   147.2 kB
319d2f4a017f        21 hours ago        /bin/sh -c gpg --keyserver pool.sks-keyserver   132.8 MB
0cd53bbacb64        2 days ago          /bin/sh -c apt-get update && apt-get install    203.1 MB
f473448176dc        2 days ago          /bin/sh -c cd / &&   wget https://repo1.maven   6.936 MB
270334f34e77        2 days ago          /bin/sh -c #(nop)  ENV PHP_BUILD_DEPS=bzip2     0 B
e5c040ab4015        2 days ago          /bin/sh -c #(nop)  ENV PHP_INI_DIR=/usr/local   0 B
c7e46e9e4df7        2 days ago          /bin/sh -c #(nop)  ENV PHP_VERSION=5.6.24       0 B
37ec6aa6e336        3 days ago          /bin/sh -c #(nop)  ENV WM_VERSION=1.57          0 B
0f0168d4061c        3 days ago          /bin/sh -c #(nop)  ENV WM_PKG_NAME=wiremock     0 B
69a777edb6dc        2 weeks ago         /bin/sh -c /var/lib/dpkg/info/ca-certificates   418.2 kB
<missing>           2 weeks ago         /bin/sh -c set -x  && apt-get update  && apt-   349.3 MB
<missing>           2 weeks ago         /bin/sh -c #(nop) ENV CA_CERTIFICATES_JAVA_VE   0 B
<missing>           2 weeks ago         /bin/sh -c #(nop) ENV JAVA_DEBIAN_VERSION=8u1   0 B
<missing>           2 weeks ago         /bin/sh -c #(nop) ENV JAVA_VERSION=8u102        0 B
<missing>           2 weeks ago         /bin/sh -c #(nop) ENV JAVA_HOME=/usr/lib/jvm/   0 B
<missing>           2 weeks ago         /bin/sh -c {   echo '#!/bin/sh';   echo 'set    87 B
<missing>           2 weeks ago         /bin/sh -c #(nop) ENV LANG=C.UTF-8              0 B
<missing>           2 weeks ago         /bin/sh -c echo 'deb http://httpredir.debian.   61 B
<missing>           2 weeks ago         /bin/sh -c apt-get update && apt-get install    1.286 MB
<missing>           4 weeks ago         /bin/sh -c apt-get update && apt-get install    122.6 MB
<missing>           4 weeks ago         /bin/sh -c apt-get update && apt-get install    44.3 MB
<missing>           4 weeks ago         /bin/sh -c #(nop) CMD ["/bin/bash"]             0 B
<missing>           4 weeks ago         /bin/sh -c #(nop) ADD file:0e0565652aa852f620   125.1 MB

首先,“丢失”的图层ID让我的蜘蛛感觉到抽搐,但这显然是由于某些内部图层键引用了Docker 1.10中的更改。但是,这些层是来自java:8构建的层。完整的--no-trunc版本在这里 - http://pastebin.com/0VcBTAVc

运行图像

PHP-CLI-wiremock

docker pull localhost:5000/php-cli-wiremock:latest; docker run -it --rm localhost:5000/php-cli-wiremock:latest ls -l /usr/bin/java

lrwxrwxrwx 1 root root 22 Aug 10 18:41 /usr/bin/java -> /etc/alternatives/java

PHP-CLI-wiremock-postgres的

docker pull localhost:5000/php-cli-wiremock-postgres:latest; docker run -it --rm localhost:5000/php-cli-wiremock-postgres:latest ls -l /usr/bin/java

ls: cannot access /usr/bin/java: No such file or directory

备注

  • 我在Docker for Mac上使用容器化私有注册表(localhost:5000)
  • 运行它
  • Docker版本为1.12
  • 我使用docker build --no-cache

检查输出

的java:8

Matthews-iMac:container-management matt$ docker inspect java:8 + docker inspect java:8 [ { "Id": "sha256:69a777edb6dcb32c2e717f69f281ee405cef6deac6de24520aefe76594a6eae5", "RepoTags": [ "java:8" ], "RepoDigests": [ "java@sha256:1064e0e67166f8859dd7e1aa1104ffc00133bcf19dbd426447cce6f90319031e" ], "Parent": "", "Comment": "", "Created": "2016-08-10T18:41:32.240355112Z", "Container": "b8c4a5096022b105ae0795a451a259263077e32c1b546406eb176bffa337b815", "ContainerConfig": { "Hostname": "2da0903ff372", "Domainname": "", "User": "", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "Tty": false, "OpenStdin": false, "StdinOnce": false, "Env": [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "LANG=C.UTF-8", "JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64", "JAVA_VERSION=8u102", "JAVA_DEBIAN_VERSION=8u102-b14.1-1~bpo8+1", "CA_CERTIFICATES_JAVA_VERSION=20140324" ], "Cmd": [ "/bin/sh", "-c", "/var/lib/dpkg/info/ca-certificates-java.postinst configure" ], "ArgsEscaped": true, "Image": "sha256:16b9751e127e1164753a577be9cab63f2c878012f936cfaf4c3ac44e37d6ca49", "Volumes": null, "WorkingDir": "", "Entrypoint": null, "OnBuild": [], "Labels": {} }, "DockerVersion": "1.10.3", "Author": "", "Config": { "Hostname": "2da0903ff372", "Domainname": "", "User": "", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "Tty": false, "OpenStdin": false, "StdinOnce": false, "Env": [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "LANG=C.UTF-8", "JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64", "JAVA_VERSION=8u102", "JAVA_DEBIAN_VERSION=8u102-b14.1-1~bpo8+1", "CA_CERTIFICATES_JAVA_VERSION=20140324" ], "Cmd": [ "/bin/bash" ], "ArgsEscaped": true, "Image": "sha256:16b9751e127e1164753a577be9cab63f2c878012f936cfaf4c3ac44e37d6ca49", "Volumes": null, "WorkingDir": "", "Entrypoint": null, "OnBuild": [], "Labels": {} }, "Architecture": "amd64", "Os": "linux", "Size": 643047426, "VirtualSize": 643047426, "GraphDriver": { "Name": "aufs", "Data": null }, "RootFS": { "Type": "layers", "Layers": [ "sha256:2f71b45e4e254ddceb187b1467f5471f0e14d7124ac2dd7fdd7ddbc76e13f0e5", "sha256:66d8e5ee400cb0660c8c0ad51d30d822365a995eb90d35750a1e641cae7c887c", "sha256:1050aff7cfff31f37ff91f26ebe8583521a9329da5a7d179400228551b1506cf", "sha256:c6952565c883c0d36287bfa0dadfe1caa2a5b8a92b10413dc0747396aae87fd4", "sha256:a0163fd1c828b8da7e032443fa62e41c4dc8d8275419ae9e6b9f43a36162faaf", "sha256:1a6f9199aa61e7043b82e2c69556ea17c72183c3dbca3276b08cdfdca6ee61aa", "sha256:5778f887b92c3a990e398921f0eac0c5ddac01d90ee0af731a1f7a2cf13b1463", "sha256:e4ecd84596333b047c22385770f8325c18dab2157505917006c0cb6436071695" ] } } ]

PHP-CLI-wiremock-postgres的

+ docker inspect localhost:5000/php-cli-wiremock-postgres:latest [ { "Id": "sha256:b6243b6f44fc3dff8cbbcbc91fc3715e136c3a65141744e5b3373454702f37ae", "RepoTags": [ "localhost:5000/php-cli-wiremock-postgres:latest" ], "RepoDigests": [ "localhost:5000/php-cli-wiremock-postgres@sha256:0546a57c3b35742b2e1b2eaad583529ba69086fcfc23172fdf39ac7da360be19" ], "Parent": "sha256:cb7b81da318114a78b5aec213677af517c294225fca54c523ce6d850daaa8fed", "Comment": "", "Created": "2016-08-26T11:52:20.102044903Z", "Container": "98db8815817150473887720b87d61143fa0890b100a7085e82a08bab3ddf2c08", "ContainerConfig": { "Hostname": "2da0903ff372", "Domainname": "", "User": "", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "ExposedPorts": { "5432/tcp": {}, "8080/tcp": {} }, "Tty": false, "OpenStdin": false, "StdinOnce": false, "Env": [ "PATH=/usr/lib/postgresql/9.5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "LANG=en_US.utf8", "JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64", "JAVA_VERSION=8u102", "JAVA_DEBIAN_VERSION=8u102-b14.1-1~bpo8+1", "CA_CERTIFICATES_JAVA_VERSION=20140324", "WM_PKG_NAME=wiremock", "WM_VERSION=1.57", "PHP_VERSION=5.6.24", "PHP_INI_DIR=/usr/local/etc/php", "PHP_BUILD_DEPS=bzip2 \t\tfile \t\tlibbz2-dev \t\tlibcurl4-openssl-dev \t\tlibjpeg-dev \t\tlibmcrypt-dev \t\tlibpng12-dev \t\tlibreadline6-dev \t\tlibssl-dev \t\tlibxslt1-dev \t\tlibxml2-dev \t\tlibreadline-dev \t\tlibncursesw5-dev \t\tlibnewt-dev", "GOSU_VERSION=1.7", "PG_MAJOR=9.5", "PG_VERSION=9.5.4-1.pgdg80+1", "PGDATA=/var/lib/postgresql/data" ], "Cmd": [ "/bin/sh", "-c", "#(nop) ", "EXPOSE 5432/tcp" ], "ArgsEscaped": true, "Image": "sha256:cb7b81da318114a78b5aec213677af517c294225fca54c523ce6d850daaa8fed", "Volumes": null, "WorkingDir": "", "Entrypoint": [ "/docker-entrypoint.sh" ], "OnBuild": [], "Labels": {} }, "DockerVersion": "1.12.0", "Author": "", "Config": { "Hostname": "2da0903ff372", "Domainname": "", "User": "", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "ExposedPorts": { "5432/tcp": {}, "8080/tcp": {} }, "Tty": false, "OpenStdin": false, "StdinOnce": false, "Env": [ "PATH=/usr/lib/postgresql/9.5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "LANG=en_US.utf8", "JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64", "JAVA_VERSION=8u102", "JAVA_DEBIAN_VERSION=8u102-b14.1-1~bpo8+1", "CA_CERTIFICATES_JAVA_VERSION=20140324", "WM_PKG_NAME=wiremock", "WM_VERSION=1.57", "PHP_VERSION=5.6.24", "PHP_INI_DIR=/usr/local/etc/php", "PHP_BUILD_DEPS=bzip2 \t\tfile \t\tlibbz2-dev \t\tlibcurl4-openssl-dev \t\tlibjpeg-dev \t\tlibmcrypt-dev \t\tlibpng12-dev \t\tlibreadline6-dev \t\tlibssl-dev \t\tlibxslt1-dev \t\tlibxml2-dev \t\tlibreadline-dev \t\tlibncursesw5-dev \t\tlibnewt-dev", "GOSU_VERSION=1.7", "PG_MAJOR=9.5", "PG_VERSION=9.5.4-1.pgdg80+1", "PGDATA=/var/lib/postgresql/data" ], "Cmd": null, "ArgsEscaped": true, "Image": "sha256:cb7b81da318114a78b5aec213677af517c294225fca54c523ce6d850daaa8fed", "Volumes": null, "WorkingDir": "", "Entrypoint": [ "/docker-entrypoint.sh" ], "OnBuild": [], "Labels": {} }, "Architecture": "amd64", "Os": "linux", "Size": 1133462572, "VirtualSize": 1133462572, "GraphDriver": { "Name": "aufs", "Data": null }, "RootFS": { "Type": "layers", "Layers": [ "sha256:2f71b45e4e254ddceb187b1467f5471f0e14d7124ac2dd7fdd7ddbc76e13f0e5", "sha256:66d8e5ee400cb0660c8c0ad51d30d822365a995eb90d35750a1e641cae7c887c", "sha256:1050aff7cfff31f37ff91f26ebe8583521a9329da5a7d179400228551b1506cf", "sha256:c6952565c883c0d36287bfa0dadfe1caa2a5b8a92b10413dc0747396aae87fd4", "sha256:a0163fd1c828b8da7e032443fa62e41c4dc8d8275419ae9e6b9f43a36162faaf", "sha256:1a6f9199aa61e7043b82e2c69556ea17c72183c3dbca3276b08cdfdca6ee61aa", "sha256:5778f887b92c3a990e398921f0eac0c5ddac01d90ee0af731a1f7a2cf13b1463", "sha256:e4ecd84596333b047c22385770f8325c18dab2157505917006c0cb6436071695", "sha256:942a8ea4fa066724a265d07c7d35f6c45f393d1ce914f8ca40d83e99af65bf85", "sha256:94a8ddf232d34524edf57c10e86aecdc87c5e6b28c35bbace94b68197a36b609", "sha256:003a5be98635727e92806f0c7961f4d8f7281a7289389acfb55145966f4d424e", "sha256:d615c4e8af228c611c96d3d9867f2d9f9a90200e6cfffeaf777ac0374cb476b7", "sha256:5dee5fbf6d8f7117e2a9f759612b5c875610d1b378b48030be9ce0703385164c", "sha256:fb09a6741ff94b60f5a9dc292fd13fc0d6a19eaba49d6b8eebbd677467d66574", "sha256:049561e8ed827b1a45d57148442c313af7585572d224ebe2a8338d9970febe14", "sha256:838640dbcacdaafacb5fab5b53d4118ad42a6a7cc221c49cc0ab497ee8fc9322", "sha256:385eb0d637e83a16a7848b37eb0532bb96c8a87aa88da7a8e479b0cd9d6568d7", "sha256:b01776fa0320292eeb78b5bdf9f3154627d57ea8c691f7f6e54686eba2785d9f", "sha256:adcebb7a5f805da7487b7b7a28addebe5260861ef238f32fd60bb663388962f7", "sha256:74bf92ac3fdd233ca67fd82bd7af11ffb46a77575a670b7b5eef1f26cc076766", "sha256:939e18c0cc00dfc57f2474ca1078996038ebe0ef66a54ebd58d5534769a239e2", "sha256:20a1c7a1d1d224dc5d14ebd4118dd41b6f836903d0c0bb17c82d39ce5b80d68d", "sha256:a073365847a62f6d5bedd4d85cfba0d64fc17dd9f3d3fd04ef38416709b0570f", "sha256:a66bd2f198ff2b97a46edb3b9fd7339ef29a3df9a08a2047d0d87d21105260a9", "sha256:515034b141d70165c0d589777b1115ca18c601bdaddd6d44ead95a8056c7eade", "sha256:9bb3e8a75f5fc430427a8a3c76e3be31ef471dd129b767667ceb74d63c41e8a3", "sha256:a4df8a72c1e91d9c07c219667e48f7a197baee694ada5098da2c5689fae6068e", "sha256:3380f90fc77766f3268563948a9bddac916dbcb30748bd3e06acc119deee962f", "sha256:0306af8e0aff6d94becb4bd7fa4f7943b2187253cfd3b6e54ea488d5429ef926" ] } } ]

1 个答案:

答案 0 :(得分:1)

Docker有一个图层限制,那就是你遇到的。尝试使用'&amp;&amp;'合并尽可能多的RUN语句。是的,这意味着您将无法按照您的方式对您的部分进行分组,而是按语句类型和依赖顺序进行分组

http://www.extellisys.com/articles/docker-layer-overload