<p>虽然T.Arboreus的答案可能解决了解决“archive.ubuntu.com”的问题,但我认为您最后得到的错误是它不知道包<code>php5-mcrypt</code>和<code>python-pip</code>。
尽管如此,你用这两个软件包减少的Dockerfile对我有效(使用Debian 8.4和Docker 1.11.0),但我不确定是否是这样,因为我的主机系统与你的不同。</p>
<pre><code>FROM ubuntu:14.04
# Install dependencies
RUN apt-get update && apt-get install -y \
php5-mcrypt \
python-pip
</code></pre>
<p>但是,根据<a href="https://stackoverflow.com/a/6587528/5755166">this answer</a>,在使用Python 3.x时,应该考虑安装<code>python3-pip</code>包,而不是<code>python-pip</code>包</p>
<p>此外,要使<code>php5-mcrypt</code>包安装工作,您可能需要添加universe存储库,如图所示<a href="https://askubuntu.com/a/483188">right here</a>。我遇到了Ubuntu Docker映像中缺少<code>add-apt-repository</code>命令的问题,所以我首先安装了<code>software-properties-common</code>包以使该命令可用。</p>
<p>分割语句并将<code>apt-get update</code>和<code>apt-get install</code>放在一个<code>RUN</code>命令中也是推荐的<a href="https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/" rel="noreferrer">here</a>。</p>
<p>哦,顺便说一下,您实际上不需要在<code>apt-get update</code>处使用<code>-y</code>标志,因为没有什么需要自动确认的。</p>
<h2>最后:</h2>
<pre><code>FROM ubuntu:14.04
# Install dependencies
RUN apt-get update && apt-get install -y \
software-properties-common
RUN add-apt-repository universe
RUN apt-get update && apt-get install -y \
apache2 \
curl \
git \
libapache2-mod-php5 \
php5 \
php5-mcrypt \
php5-mysql \
python3.4 \
python3-pip
</code></pre>
<p>备注:使用过的版本(如Ubuntu)将来可能会过时。</p>