I would like to prepare the environment for a Docker container such that when
apt-get upgrade -s runs inside the container its result is the same as if the command were run outside on the host. This is in the context of and in preparation for adding a text collector
apt.sh to an existing Prometheus
node-exporter. I am already using a Kubernetes
DaemonSet to control such containers (pods) in a way similar to an example from GitHub
Judging from its man page,
apt-get works with files in
/var/lib/apt, and so my container mounts those read-only from the host. Currently my host and container run Debian 9 (Stretch) and Debian 10 (Buster) respectively. I account for this by running
apt-get upgrade -s outside the container and
apt-get upgrade -s -t stretch inside.
However the two runs still produce different results. What am I missing?