I recently had an issue using
tail -F logfile.log in a Dockerfile
The logfile already exists in the previous image layer, and as the system writes to it, Docker copies it into the container layer changing it’s inode value.
The tail command should be able to handle this with the -F flag, but it would hang and not pick up any changes once the inode changed.
I’m a Linux/Docker beginner and I’m wondering if this is a bug with Docker, or just something that is not possible and needs a workaround.
ps. My workaround was to force Docker to create the new file before starting the tail
touch logfile.log && tail -F logfile.log