从Dockerfile构buildDocker镜像:无法启动容器

我正在尝试使用现有的Dockerfile来构build新的图像。 看起来好像在某个时候从caching中恢复了。 但是构build并没有像apt安装/更新这样的非常简单的步骤发展。 如何获得有关实际错误的更多信息以及如何从该状态恢复? 非常感谢!

... Step 15 : RUN apt-get install -y cron ---> Using cache ---> a2a6dea37a20 Step 16 : RUN apt-get install -y vim ---> Using cache ---> a2a5dea37a19 Step 17 : RUN apt-get install -y debsecan ---> Using cache ---> cc2aa4c994c2 Step 18 : RUN apt-get install -y links ---> Using cache ---> abb32d4543f6 Step 19 : RUN apt-get update ---> Running in 68c12197bcfd Cannot start container 68c12197bcfd12f39e669dc4ba1f1dc07a6fde07c675b6e763...: [9] System error: exit status 1 

docker版本

 Client: Version: 1.10.3 API version: 1.22 Package version: docker-common-1.10.3-46.el7.14.x86_64 Go version: go1.6.3 Git commit: 8f9d39a-unsupported Built: Thu Sep 15 11:51:19 2016 OS/Arch: linux/amd64 Server: Version: 1.10.3 API version: 1.22 Package version: docker-common-1.10.3-46.el7.14.x86_64 Go version: go1.6.3 Git commit: 8f9d39a-unsupported Built: Thu Sep 15 11:51:19 2016 OS/Arch: linux/amd64 FROM debian:latest MAINTAINER me@example.com RUN apt-get update RUN apt-get upgrade -y RUN apt-get update RUN apt-get install -y sudo RUN apt-get install -y dialog RUN apt-get install -y curl RUN apt-get install -y wget RUN apt-get install -y vim RUN apt-get install -y net-tools RUN apt-get install -y apt-utils RUN apt-get install -y net-tools RUN apt-get install -y cron RUN apt-get install -y vim RUN apt-get install -y debsecan RUN apt-get install -y links RUN apt-get update RUN apt-get install -y apache2 RUN cd /var/www && mv html htmlapache RUN mkdir -p /var/www/html/repo RUN touch /var/www/html/index.html COPY entrypoint.sh / RUN apt-get -y install salt-master CMD [ "/entrypoint.sh" ] EXPOSE 8000 

您不需要多次调用apt-get update 。 在一行中更新和安装所有软件包也是一个很好的做法,因为它只在Docker镜像中创build一个图层

 FROM debian:latest MAINTAINER me@example.com RUN apt-get update \ && upgrade -y \ && apt-get install -y sudo dialog curl wget vim net-tools apt-utils net-tools cron vim debsecan links apache2 salt-master RUN cd /var/www && mv html htmlapache RUN mkdir -p /var/www/html/repo RUN touch /var/www/html/index.html COPY entrypoint.sh / CMD [ "/entrypoint.sh" ] EXPOSE 8000