当依赖包损坏时,如何安装 nginx?

当依赖包损坏时,如何安装 nginx?

这似乎是一个非常简单的问题。

但是,我正在尝试创建一个包含 nginx 的 docker 容器,但它崩溃了。

我的 dockerfile 包含......

FROM ubuntu:14.04

RUN apt-get -qq update
RUN apt-get -yqq upgrade
RUN apt-get -f install
RUN apt-get -yq install --no-install-recommends nginx
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
RUN sed -i '/access_log/s|/[^;]\+|/dev/stdout|' /etc/nginx/nginx.conf
RUN sed -i '/error_log/s|/[^;]\+|/dev/stdout|' /etc/nginx/nginx.conf
RUN chmod 777 /dev/stdout

但中途我得到了:

After this operation, 916 kB of additional disk space will be used.
Err http://archive.ubuntu.com/ubuntu/ trusty-updates/main libfreetype6 amd64 2.5.2-1ubuntu2.2
  404  Not Found [IP: 91.189.91.24 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/f/freetype/libfreetype6_2.5.2-1ubuntu2.2_amd64.deb  404  Not Found [IP: 91.189.91.24 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
2015/03/23 21:58:01 The command [/bin/sh -c apt-get -yq install libfreetype6] returned a non-zero code: 100

我认为这是一个错误。我没有时间提交错误报告,只是需要它尽快恢复。

我不确定为什么 nginx 甚至依赖于 freetype。有没有办法在不使用 freetype 的情况下安装它,同时仍让 nginx 工作?

答案1

有多个 nginx 包可用。默认的nginx-core依赖于一些引入 的字体相关包libfreetype6。最小的nginx-light不依赖于libfreetype6

$ apt-rdepends nginx-light | grep freetype 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
$ 

因此,为了快速解决问题,请安装nginx-light

相关内容