0

I am trying to install docker cron package in running prometheus docker container. I downloaded cron package but somehow it is not allowing me do that. I downloaded cron package using wget command. Also it doesn't let me configure dpkg.

/prometheus # dpkg --configure
dpkg: can't open '/var/lib/dpkg/status': No such file or directory
/prometheus # dpkg -i cron_3.0pl1-127+deb8u1_amd64.deb
dpkg: can't open '/var/lib/dpkg/status': No such file or directory

Now when i try to create lib/dpkg folder in /var/ folder.

/prometheus # mkdir /var/lib/dpkg
mkdir: can't create directory '/var/lib/dpkg': No such file or directory

I don't understand what I am doing wrong. I don't see any disk space issue or inode issue.

/prometheus # df -kh
Filesystem                Size      Used Available Use% Mounted on
overlay                  93.7G     43.4G     46.1G  48% /
tmpfs                    15.0G         0     15.0G   0% /dev
tmpfs                    15.0G         0     15.0G   0% /sys/fs/cgroup
/dev/xvdbs               98.3G     18.3G     75.0G  20% /prometheus
/dev/xvda1               93.7G     43.4G     46.1G  48% /dev/termination-log
/dev/xvda1               93.7G     43.4G     46.1G  48% /etc/prometheus
/dev/xvda1               93.7G     43.4G     46.1G  48% /etc/resolv.conf
/dev/xvda1               93.7G     43.4G     46.1G  48% /etc/hostname
/dev/xvda1               93.7G     43.4G     46.1G  48% /etc/hosts
shm                      64.0M         0     64.0M   0% /dev/shm
tmpfs                    15.0G     12.0K     15.0G   0% /var/run/secrets/kubernetes.io/serviceaccount
tmpfs                    15.0G         0     15.0G   0% /proc/kcore
tmpfs                    15.0G         0     15.0G   0% /proc/timer_list
tmpfs                    15.0G         0     15.0G   0% /proc/timer_stats
tmpfs                    15.0G         0     15.0G   0% /proc/sched_debug

/prometheus # df -i
Filesystem              Inodes      Used Available Use% Mounted on
overlay               26214400   5793478  20420922  22% /
tmpfs                  3925290        18   3925272   0% /dev
tmpfs                  3925290        15   3925275   0% /sys/fs/cgroup
/dev/xvdbs             6553600    177485   6376115   3% /prometheus
/dev/xvda1            26214400   5793478  20420922  22% /dev/termination-log
/dev/xvda1            26214400   5793478  20420922  22% /etc/prometheus
/dev/xvda1            26214400   5793478  20420922  22% /etc/resolv.conf
/dev/xvda1            26214400   5793478  20420922  22% /etc/hostname
/dev/xvda1            26214400   5793478  20420922  22% /etc/hosts
shm                    3925290         1   3925289   0% /dev/shm
tmpfs                  3925290         9   3925281   0% /var/run/secrets/kubernetes.io/serviceaccount
tmpfs                  3925290        18   3925272   0% /proc/kcore
tmpfs                  3925290        18   3925272   0% /proc/timer_list
tmpfs                  3925290        18   3925272   0% /proc/timer_stats
tmpfs                  3925290        18   3925272   0% /proc/sched_debug

I don't have a /var/log/ folder either in my container where I check the logs. and I am root as you can see below. It's busybox container since busybox is the base image used by prometheus.

/etc/prometheus # whoami
root

After running mkdir -p /var/lib/dpkg command I was able to get rid of previous error message just to land in new error.

/prometheus # dpkg -i cron_3.0pl1-127+deb8u1_amd64.deb
dpkg: package cron pre-depends on dpkg, which is not installed or flagged to be installed
Shailesh Sutar
  • 1,427
  • 4
  • 22
  • 40
  • try `mkdir -p`. – Gerald Schneider Aug 06 '18 at 12:32
  • Thanks for correcting me. I was able to create required folders for dpkg command execution. however my problem isn't solved yet. Updating my question here. – Shailesh Sutar Aug 06 '18 at 12:39
  • Can you tell us the OS the docker container is running on? Also, what kind of storage driver is in use? I have had some weird file permission issues with `overlay` and a very specific combination of layers with deleted directories. – Pablo Aug 06 '18 at 13:04
  • when I do `uname -a` it gives me following `Linux mo-monitoring-0 4.4.110-k8s #1 SMP Fri Jan 5 16:59:17 UTC 2018 x86_64 GNU/Linux` I think it's GNU/Linux – Shailesh Sutar Aug 06 '18 at 13:57
  • Finally I gave up on installing a cron package solution and implemented another solution to achieve my objective. Now I am running my cron from a admin node which deletes orphaned files from my prometheus container. – Shailesh Sutar Aug 10 '18 at 13:31

0 Answers0