Debian
在 NGINX Docker 映像上安裝軟體包後失去文件
我正在 Docker 映像上安裝
fcgiwrap
軟體包nginx
(基於 Debian Bullseye),並且某些文件似乎失去了。這可能是顯而易見的,但我找不到解釋,這是我嘗試過的一切:1. 使用包建構 Docker 鏡像
FROM nginx:latest RUN apt-get update \ && apt-get -q install -y \ fcgiwrap \ && rm -rf /var/lib/apt/lists/*
執行後(即
docker run -it my-image /bin/bash
),如果我列出/usr/share/doc/fcgiwrap
我只能看到一個copyright
文件和空examples
文件夾。2.執行基礎鏡像,直接安裝
docker run -it nginx /bin/bash
然後apt install fcgiwrap
,文件仍然失去。3.執行基礎鏡像並安裝
dpkg
docker run -it nginx /bin/bash
然後:
apt-get install -d fcgiwrap
cd /var/cache/apt/archives
,顯示:fcgiwrap_1.1.0-12_amd64.deb libfcgi0ldbl_2.4.2-2_amd64.deb partial libfcgi-bin_2.4.2-2_amd64.deb lock spawn-fcgi_1.6.4-2_amd64.deb
dpkg --contents fcgiwrap_1.1.0-12_amd64.deb
,顯示:drwxr-xr-x root/root 0 2018-12-09 15:58 ./ drwxr-xr-x root/root 0 2018-12-09 15:58 ./etc/ drwxr-xr-x root/root 0 2018-12-09 15:58 ./etc/init.d/ -rwxr-xr-x root/root 7231 2016-07-09 22:42 ./etc/init.d/fcgiwrap drwxr-xr-x root/root 0 2018-12-09 15:58 ./lib/ drwxr-xr-x root/root 0 2018-12-09 15:58 ./lib/systemd/ drwxr-xr-x root/root 0 2018-12-09 15:58 ./lib/systemd/system/ -rw-r--r-- root/root 273 2018-12-09 15:58 ./lib/systemd/system/fcgiwrap.service -rw-r--r-- root/root 114 2018-12-09 15:58 ./lib/systemd/system/fcgiwrap.socket drwxr-xr-x root/root 0 2018-12-09 15:58 ./usr/ drwxr-xr-x root/root 0 2018-12-09 15:58 ./usr/sbin/ -rwxr-xr-x root/root 26776 2018-12-09 15:58 ./usr/sbin/fcgiwrap drwxr-xr-x root/root 0 2018-12-09 15:58 ./usr/share/ drwxr-xr-x root/root 0 2018-12-09 15:58 ./usr/share/doc/ drwxr-xr-x root/root 0 2018-12-09 15:58 ./usr/share/doc/fcgiwrap/ -rw-r--r-- root/root 825 2016-07-09 20:50 ./usr/share/doc/fcgiwrap/README.Debian -rw-r--r-- root/root 3018 2018-12-09 15:58 ./usr/share/doc/fcgiwrap/changelog.Debian.gz -rw-r--r-- root/root 1483 2017-08-05 16:19 ./usr/share/doc/fcgiwrap/copyright drwxr-xr-x root/root 0 2018-12-09 15:58 ./usr/share/doc/fcgiwrap/examples/ -rw-r--r-- root/root 501 2016-07-09 22:42 ./usr/share/doc/fcgiwrap/examples/default -rw-r--r-- root/root 229 2016-07-09 20:04 ./usr/share/doc/fcgiwrap/examples/monitrc -rw-r--r-- root/root 648 2016-07-09 20:04 ./usr/share/doc/fcgiwrap/examples/nginx.conf drwxr-xr-x root/root 0 2018-12-09 15:58 ./usr/share/man/ drwxr-xr-x root/root 0 2018-12-09 15:58 ./usr/share/man/man8/ -rw-r--r-- root/root 1785 2018-12-09 15:58 ./usr/share/man/man8/fcgiwrap.8.gz
dpkg -i spawn-fcgi_1.6.4-2_amd64.deb
dpkg -i libfcgi0ldbl_2.4.2-2_amd64.deb
dpkg -i fcgiwrap_1.1.0-12_amd64.deb
ls /usr/share/doc/fcgiwrap/
顯示:copyright examples
cat /usr/share/doc/fcgiwrap/README.Debian
顯示:cat: /usr/share/doc/fcgiwrap/README.Debian: No such file or directory
知道這裡發生了什麼嗎?
我想我問得太早了,看起來一些 Docker 映像預設禁用安裝文件,使用類似於以下規則:https://askubuntu.com/a/541061,在文件中
/etc/dpkg/dpkg.cfg.d/docker
。