Docker Community Forums

Share and learn in the Docker community.

Tail -F on a layered filesystem

(Edwinwright) #1

Hi All,

I recently had an issue using tail -F logfile.log in a Dockerfile RUN command.

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