Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RUN <process> can leave processes running in the background #247

Closed
fabiokung opened this issue Jul 21, 2018 · 1 comment
Closed

RUN <process> can leave processes running in the background #247

fabiokung opened this issue Jul 21, 2018 · 1 comment
Assignees
Labels
kind/bug Something isn't working

Comments

@fabiokung
Copy link

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:

archive/tar: write too long

... 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, and kill -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't unshare 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.

@dlorenc
Copy link
Collaborator

dlorenc commented Jul 23, 2018

Yeah we should definitely fix this one. I think we'll need to use the process group technique.

@priyawadhwa priyawadhwa added the kind/bug Something isn't working label Jul 24, 2018
balopat added a commit to balopat/kaniko that referenced this issue Jul 26, 2018
balopat added a commit to balopat/kaniko that referenced this issue Jul 26, 2018
balopat added a commit to balopat/kaniko that referenced this issue Jul 26, 2018
imjasonh added a commit to imjasonh/catalog that referenced this issue Mar 10, 2021
- use newer jq image built by imega
- explicitly list capabilities kaniko should have, including KILL to
  stop background processes
  (see GoogleContainerTools/kaniko#247)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants