I'm trying to write a hardening script to remove the cron directory in an alpine Linux based docker image.
docker run -it alpine:3.7
rm -rf /var/spool/cron
rm: can't remove '/var/spool/cron': Invalid argument
Sometimes the cron directory appears to have a crontabs file in it sometimes not, and removing it makes no difference to being able to delete the folder.
The odd part is that this is on an Amazon Linux 2 Image, if I try from my Windows development box or an Ubuntu AMI the directory is able to be removed without issue.
Whats going on here?