docker-library / buildpack-deps

MIT License
445 stars 113 forks source link

Some files are missing from new package installs on bionic containers #101

Closed mike10004 closed 4 years ago

mike10004 commented 4 years ago

In containers based on the bionic-curl and bionic-scm images, for some new packages installed with apt, not all files in the package are present after installation. In particular, some files under /usr/share/doc and /usr/share/man are missing.

Steps to reproduce:

$ docker run --rm -it buildpack-deps:bionic-curl /bin/bash -l

root@73b619bd6c3e:/# apt update > /dev/null 2> /dev/null
root@73b619bd6c3e:/# apt install hello
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  hello
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 27.2 kB of archives.
After this operation, 111 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic/main amd64 hello amd64 2.10-1build1 [27.2 kB]
Fetched 27.2 kB in 0s (85.1 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package hello.
(Reading database ... 4763 files and directories currently installed.)
Preparing to unpack .../hello_2.10-1build1_amd64.deb ...
Unpacking hello (2.10-1build1) ...
Setting up hello (2.10-1build1) ...
root@73b619bd6c3e:/# dpkg --verify hello
??5??????   /usr/share/doc/hello/NEWS.gz
??5??????   /usr/share/man/man1/hello.1.gz
root@73b619bd6c3e:/# ls /usr/share/doc/hello/NEWS.gz 
ls: cannot access '/usr/share/doc/hello/NEWS.gz': No such file or directory
root@73b619bd6c3e:/# ls /usr/share/man/man1/hello.1.gz
ls: cannot access '/usr/share/man/man1/hello.1.gz': No such file or directory

The output of dpkg --verify and ls shows that the files are missing.

This behavior is not exhibited on xenial-curl or buster-curl.

Any idea what could be causing this or how to address it?

tianon commented 4 years ago

This was an intentional upstream Ubuntu change for Bionic+ Docker images: https://github.com/tianon/docker-brew-ubuntu-core/issues/122

mike10004 commented 4 years ago

Thank you for the quick and relevant response -- googling what I was seeing was bringing up all the wrong leads.

For anyone stumbling on this, you can add the line

RUN rm /etc/dpkg/dpkg.cfg.d/excludes

to your dockerfile to make dpkg behave normally and unpack files in /usr/share/doc and /usr/share/man.