首页 > 解决方案 > 运行“RUN apt-get update -y”时无法构建基于“php:5.6.32-apache”的 docker 映像

问题描述

我想构建一个基于php:5.6.32-apache.

我的 Dockerfile 中涉及的内容是:

FROM php:5.6.32-apache

....

RUN apt-get update -y

构建过程的控制台输出是:

Step 6/10 : RUN apt-get update -y
 ---> Running in 8781a7a005ad
Get:1 http://security.debian.org jessie/updates InRelease [44.9 kB]
Ign http://deb.debian.org jessie InRelease
Get:2 http://deb.debian.org jessie-updates InRelease [7340 B]
Get:3 http://deb.debian.org jessie Release.gpg [2420 B]
Get:4 http://deb.debian.org jessie Release [148 kB]
Get:5 http://security.debian.org jessie/updates/main amd64 Packages [846 kB]
Get:6 http://deb.debian.org jessie/main amd64 Packages [9098 kB]
W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/InRelease  Unable to find expected entry 'main/binary-amd64/Packages' in Release file (Wrong sources.list entry or malformed file)

E: Some index files failed to download. They have been ignored, or old ones used instead.
Fetched 10.1 MB in 17s (565 kB/s)
ERROR: Service 'php' failed to build: The command '/bin/sh -c apt-get update -y' returned a non-zero code: 100

您可以在此处找到原始 php:5.6.32-apache Dockerfilehttps ://github.com/docker-library/php/blob/ec6b6e60b42c283d48775596f722f5250c1f5ca5/5.6/jessie/apache/Dockerfile

复制。请在以下位置找到解决方案:构建错误。未能获取构建错误。无法获取 http://deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages

标签: dockerdockerfiledebian-jessie

解决方案


推荐阅读