2

I have a dockerfile which specified 12 ubuntu dependencies to install. I created a docker image and then spin up a container using that docker image. I just tried to list out the dependencies present in the docker image by "apt list --installed" (by using shell inside running container). I am able to see 409 dependencies which also include automatically installed dependencies. Is there any way by which I can list out only those 12 dependencies listed in docker file?

2 Answers2

1

In your container shell, you should try to look for a log file mentioning the recent installed packages.

See "Is it possible to get a list of most recently installed packages?"

For instance:

grep " install " /var/log/dpkg.log
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks @Vonc, the link you shared lists out all the recently installed ubuntu dependencies. Is there any way to list out recently installed python dependencies too. – Sushil Raut Jul 06 '18 at 17:16
  • @SushilRaut Not sure, as python dependencies are installed through pip (https://stackoverflow.com/a/23885252/6309) – VonC Jul 06 '18 at 18:25
0

I would spin up an instance of the base image and list its packages, then diff that list from the one for your derived instance.

emory
  • 10,725
  • 2
  • 30
  • 58