RUN <process>
can leave processes running in the background
#247
Labels
kind/bug
Something isn't working
RUN <process>
can leave processes running in the background
#247
Some
RUN
instructions on Dockerfiles can leave processes running in the background (e.g. daemons). If these daemons are writting to files in the context dir,tar
will fail with:... when the layer is being snapshotted, because files were modified after the tar header was written.
One idea to prevent this is to execute
RUN
instructions in a nested PID namespace, andkill -9
its PID 1 before proceeding to the next instruction. Or perhaps a poor man's version of it with process groups to minimize the problem on environments that can'tunshare
a nested PID namespace.It is easy to reproduce this when building Dockerfiles that use
gradlew
, which spawns a daemon by default, and is constantly writting to a log file inside the layer.The text was updated successfully, but these errors were encountered: