Closed mderoy closed 3 years ago
I don't see docker build --init? I do see docker run --init.
Podman run --init exists as well?
I'll provide more details :) (Also greetings from one town over in Littleton :D)
We have a legacy application which we've now shipped a containerized solution for. Our application has an installer, and in production our container build just runs this installer....we're using ubi-init so that our legacy application can work with the systemd services it needs to run.
In development though, we have the desire to build a "development container" which rather than going through the installer, would pull our source code and perform a build (so we have a full development environment where we can change source code, build, etc in our container). unfortunately our build will hang forever because somewhere in our build we're waiting for some build tool (if I remember correctly fakeroot) to finish by checking that the PID has been cleaned up
The issue is, there is no option to do buildah bud --init so that we have an init process while we're building our container image layer by layer.
Aside from altering our build process, our options are then limited to
Obviously altering our build process to workaround this PID check would be the quickest way for us to workaround this issue, but I'd imagine other developers might face this zombie reaping issue during their container builds when porting legacy applications, so such an argument to buildah bud may be useful.
Well my usual response to something like this is: If you want to create a PR, I am sure we would consider it.
Since no one from community has stepped up to work on this, I am going to close in one month.
A friendly reminder that this issue had no activity for 30 days.
Description The PID 1 reaping issue described here https://blog.phusion.nl/2015/01/20/docker-and-the-pid-1-zombie-reaping-problem is probably the nastiest docker quirk I've ever seen. Whats worse, this PID 1 reaping issue can affect applications that are run in the Dockerfile during the container build itself! We had a tool that was waiting for a PID to go away, which never did because it became a zombie process and was never reaped (pid 1 was not reaping it) you can work around the issue in your Dockerfile by using dumb-init or tini and running using it. This will make dumb-init/tini pid #1, and zombie process will be reaped RUN easy_install pip RUN pip install dumb-init RUN ["/usr/bin/dumb-init", "bash","-c", "/tmp/buildApp.sh"]
docker itself has a --init flag which uses tini, but 'buildah bud' does not have such a flag, that is an easier workaround for those in the docker world since every command run in the dockerfile is not run as pid 1
Steps to reproduce the issue:
Describe the results you received: build toolchain hung waiting for process to go away, but zombie process never gets cleaned up
Describe the results you expected: no hang
Output of
rpm -q buildah
orapt list buildah
:Output of
buildah version
:Output of
podman version
if reporting apodman build
issue:*Output of `cat /etc/release`:**
Output of
uname -a
:Output of
cat /etc/containers/storage.conf
: