How should one invoke docker to take care of the PID 1 problem with zombie processes?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












The phusion/baseimage boasts of taking care of the pid 1 problem with a light weight init process. How can one use the phusion/baseimage properly? I tried to invoke the image with the command ps aux shows ps running with a PID 1.



What did I do wrong? What is the proper way to use the image?



me@host:~/app1$ docker run --rm phusion/baseimage ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 3.0 0.0 29180 1404 ? Rs 01:27 0:00 ps aux






share|improve this question























    up vote
    1
    down vote

    favorite












    The phusion/baseimage boasts of taking care of the pid 1 problem with a light weight init process. How can one use the phusion/baseimage properly? I tried to invoke the image with the command ps aux shows ps running with a PID 1.



    What did I do wrong? What is the proper way to use the image?



    me@host:~/app1$ docker run --rm phusion/baseimage ps aux
    USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
    root 1 3.0 0.0 29180 1404 ? Rs 01:27 0:00 ps aux






    share|improve this question





















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      The phusion/baseimage boasts of taking care of the pid 1 problem with a light weight init process. How can one use the phusion/baseimage properly? I tried to invoke the image with the command ps aux shows ps running with a PID 1.



      What did I do wrong? What is the proper way to use the image?



      me@host:~/app1$ docker run --rm phusion/baseimage ps aux
      USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
      root 1 3.0 0.0 29180 1404 ? Rs 01:27 0:00 ps aux






      share|improve this question











      The phusion/baseimage boasts of taking care of the pid 1 problem with a light weight init process. How can one use the phusion/baseimage properly? I tried to invoke the image with the command ps aux shows ps running with a PID 1.



      What did I do wrong? What is the proper way to use the image?



      me@host:~/app1$ docker run --rm phusion/baseimage ps aux
      USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
      root 1 3.0 0.0 29180 1404 ? Rs 01:27 0:00 ps aux








      share|improve this question










      share|improve this question




      share|improve this question









      asked May 8 at 2:04









      Lord Loh.

      71641128




      71641128




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          1
          down vote













          docker has an option --init. That starts init system tini as Pid 1.



          tini is stored as /usr/bin/docker-init on host.
          Unfortunately, some systems like fedora and openSUSE miss the init binary although --init shows up in docker run --help.



          You can add tini to your docker images yourself and define entrypoint with
          ENTRYPOINT /tini --. See README for tini.



          Further informations about missing /usr/bin/docker-init at: https://github.com/mviereck/x11docker/issues/23#issuecomment-386817295






          share|improve this answer




























            up vote
            0
            down vote













            I figured out (from here) that the proper way to use the phusion/baseimage is to run it as -



            docker run --rm -t -i phusion/baseimage /sbin/my_init ps aux`


            to have my_init execute as PID1 and have my_init spawn a process for ps aux



            *** Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
            *** Running /etc/my_init.d/10_syslog-ng.init...
            May 8 04:18:23 daf3cfab8573 syslog-ng[10]: syslog-ng starting up; version='3.5.6'
            May 8 04:18:23 daf3cfab8573 syslog-ng[10]: WARNING: you are using the pipe driver, underlying file is not a FIFO, it should be used by file(); filename='/dev/stdout'
            May 8 04:18:24 daf3cfab8573 syslog-ng[10]: EOF on control channel, closing connection;
            *** Running /etc/rc.local...
            *** Booting runit daemon...
            *** Runit started as PID 16
            *** Running ps aux...
            May 8 04:18:24 daf3cfab8573 cron[20]: (CRON) INFO (pidfile fd = 3)
            May 8 04:18:24 daf3cfab8573 cron[20]: (CRON) INFO (Running @reboot jobs)
            USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
            root 1 5.0 0.0 32304 10796 ? Ss+ 04:18 0:00 /usr/bin/python3 -u /sbin/my_init ps aux
            root 10 1.0 0.0 72364 7552 ? S 04:18 0:00 /usr/sbin/syslog-ng --pidfile /var/run/syslog-ng.pid -F --no-caps
            root 16 0.0 0.0 4392 1124 ? S+ 04:18 0:00 /usr/bin/runsvdir -P /etc/service
            root 17 0.0 0.0 37656 3340 ? R+ 04:18 0:00 ps aux
            root 18 0.0 0.0 4240 672 ? Ss 04:18 0:00 runsv cron
            root 19 0.0 0.0 4240 800 ? Ss 04:18 0:00 runsv sshd
            root 20 0.0 0.0 29272 2840 ? S 04:18 0:00 /usr/sbin/cron -f
            *** ps exited with status 0.
            *** Shutting down runit daemon (PID 16)...
            *** Running /etc/my_init.post_shutdown.d/10_syslog-ng.shutdown...
            May 8 04:18:24 daf3cfab8573 syslog-ng[10]: syslog-ng shutting down; version='3.5.6'
            May 8 04:18:24 daf3cfab8573 syslog-ng[10]: EOF on control channel, closing connection;
            *** Killing all processes...





            share|improve this answer





















              Your Answer







              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "106"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              convertImagesToLinks: false,
              noModals: false,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );








               

              draft saved


              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f442441%2fhow-should-one-invoke-docker-to-take-care-of-the-pid-1-problem-with-zombie-proce%23new-answer', 'question_page');

              );

              Post as a guest






























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              1
              down vote













              docker has an option --init. That starts init system tini as Pid 1.



              tini is stored as /usr/bin/docker-init on host.
              Unfortunately, some systems like fedora and openSUSE miss the init binary although --init shows up in docker run --help.



              You can add tini to your docker images yourself and define entrypoint with
              ENTRYPOINT /tini --. See README for tini.



              Further informations about missing /usr/bin/docker-init at: https://github.com/mviereck/x11docker/issues/23#issuecomment-386817295






              share|improve this answer

























                up vote
                1
                down vote













                docker has an option --init. That starts init system tini as Pid 1.



                tini is stored as /usr/bin/docker-init on host.
                Unfortunately, some systems like fedora and openSUSE miss the init binary although --init shows up in docker run --help.



                You can add tini to your docker images yourself and define entrypoint with
                ENTRYPOINT /tini --. See README for tini.



                Further informations about missing /usr/bin/docker-init at: https://github.com/mviereck/x11docker/issues/23#issuecomment-386817295






                share|improve this answer























                  up vote
                  1
                  down vote










                  up vote
                  1
                  down vote









                  docker has an option --init. That starts init system tini as Pid 1.



                  tini is stored as /usr/bin/docker-init on host.
                  Unfortunately, some systems like fedora and openSUSE miss the init binary although --init shows up in docker run --help.



                  You can add tini to your docker images yourself and define entrypoint with
                  ENTRYPOINT /tini --. See README for tini.



                  Further informations about missing /usr/bin/docker-init at: https://github.com/mviereck/x11docker/issues/23#issuecomment-386817295






                  share|improve this answer













                  docker has an option --init. That starts init system tini as Pid 1.



                  tini is stored as /usr/bin/docker-init on host.
                  Unfortunately, some systems like fedora and openSUSE miss the init binary although --init shows up in docker run --help.



                  You can add tini to your docker images yourself and define entrypoint with
                  ENTRYPOINT /tini --. See README for tini.



                  Further informations about missing /usr/bin/docker-init at: https://github.com/mviereck/x11docker/issues/23#issuecomment-386817295







                  share|improve this answer













                  share|improve this answer



                  share|improve this answer











                  answered Jun 3 at 12:28









                  mviereck

                  1,0871310




                  1,0871310






















                      up vote
                      0
                      down vote













                      I figured out (from here) that the proper way to use the phusion/baseimage is to run it as -



                      docker run --rm -t -i phusion/baseimage /sbin/my_init ps aux`


                      to have my_init execute as PID1 and have my_init spawn a process for ps aux



                      *** Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
                      *** Running /etc/my_init.d/10_syslog-ng.init...
                      May 8 04:18:23 daf3cfab8573 syslog-ng[10]: syslog-ng starting up; version='3.5.6'
                      May 8 04:18:23 daf3cfab8573 syslog-ng[10]: WARNING: you are using the pipe driver, underlying file is not a FIFO, it should be used by file(); filename='/dev/stdout'
                      May 8 04:18:24 daf3cfab8573 syslog-ng[10]: EOF on control channel, closing connection;
                      *** Running /etc/rc.local...
                      *** Booting runit daemon...
                      *** Runit started as PID 16
                      *** Running ps aux...
                      May 8 04:18:24 daf3cfab8573 cron[20]: (CRON) INFO (pidfile fd = 3)
                      May 8 04:18:24 daf3cfab8573 cron[20]: (CRON) INFO (Running @reboot jobs)
                      USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
                      root 1 5.0 0.0 32304 10796 ? Ss+ 04:18 0:00 /usr/bin/python3 -u /sbin/my_init ps aux
                      root 10 1.0 0.0 72364 7552 ? S 04:18 0:00 /usr/sbin/syslog-ng --pidfile /var/run/syslog-ng.pid -F --no-caps
                      root 16 0.0 0.0 4392 1124 ? S+ 04:18 0:00 /usr/bin/runsvdir -P /etc/service
                      root 17 0.0 0.0 37656 3340 ? R+ 04:18 0:00 ps aux
                      root 18 0.0 0.0 4240 672 ? Ss 04:18 0:00 runsv cron
                      root 19 0.0 0.0 4240 800 ? Ss 04:18 0:00 runsv sshd
                      root 20 0.0 0.0 29272 2840 ? S 04:18 0:00 /usr/sbin/cron -f
                      *** ps exited with status 0.
                      *** Shutting down runit daemon (PID 16)...
                      *** Running /etc/my_init.post_shutdown.d/10_syslog-ng.shutdown...
                      May 8 04:18:24 daf3cfab8573 syslog-ng[10]: syslog-ng shutting down; version='3.5.6'
                      May 8 04:18:24 daf3cfab8573 syslog-ng[10]: EOF on control channel, closing connection;
                      *** Killing all processes...





                      share|improve this answer

























                        up vote
                        0
                        down vote













                        I figured out (from here) that the proper way to use the phusion/baseimage is to run it as -



                        docker run --rm -t -i phusion/baseimage /sbin/my_init ps aux`


                        to have my_init execute as PID1 and have my_init spawn a process for ps aux



                        *** Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
                        *** Running /etc/my_init.d/10_syslog-ng.init...
                        May 8 04:18:23 daf3cfab8573 syslog-ng[10]: syslog-ng starting up; version='3.5.6'
                        May 8 04:18:23 daf3cfab8573 syslog-ng[10]: WARNING: you are using the pipe driver, underlying file is not a FIFO, it should be used by file(); filename='/dev/stdout'
                        May 8 04:18:24 daf3cfab8573 syslog-ng[10]: EOF on control channel, closing connection;
                        *** Running /etc/rc.local...
                        *** Booting runit daemon...
                        *** Runit started as PID 16
                        *** Running ps aux...
                        May 8 04:18:24 daf3cfab8573 cron[20]: (CRON) INFO (pidfile fd = 3)
                        May 8 04:18:24 daf3cfab8573 cron[20]: (CRON) INFO (Running @reboot jobs)
                        USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
                        root 1 5.0 0.0 32304 10796 ? Ss+ 04:18 0:00 /usr/bin/python3 -u /sbin/my_init ps aux
                        root 10 1.0 0.0 72364 7552 ? S 04:18 0:00 /usr/sbin/syslog-ng --pidfile /var/run/syslog-ng.pid -F --no-caps
                        root 16 0.0 0.0 4392 1124 ? S+ 04:18 0:00 /usr/bin/runsvdir -P /etc/service
                        root 17 0.0 0.0 37656 3340 ? R+ 04:18 0:00 ps aux
                        root 18 0.0 0.0 4240 672 ? Ss 04:18 0:00 runsv cron
                        root 19 0.0 0.0 4240 800 ? Ss 04:18 0:00 runsv sshd
                        root 20 0.0 0.0 29272 2840 ? S 04:18 0:00 /usr/sbin/cron -f
                        *** ps exited with status 0.
                        *** Shutting down runit daemon (PID 16)...
                        *** Running /etc/my_init.post_shutdown.d/10_syslog-ng.shutdown...
                        May 8 04:18:24 daf3cfab8573 syslog-ng[10]: syslog-ng shutting down; version='3.5.6'
                        May 8 04:18:24 daf3cfab8573 syslog-ng[10]: EOF on control channel, closing connection;
                        *** Killing all processes...





                        share|improve this answer























                          up vote
                          0
                          down vote










                          up vote
                          0
                          down vote









                          I figured out (from here) that the proper way to use the phusion/baseimage is to run it as -



                          docker run --rm -t -i phusion/baseimage /sbin/my_init ps aux`


                          to have my_init execute as PID1 and have my_init spawn a process for ps aux



                          *** Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
                          *** Running /etc/my_init.d/10_syslog-ng.init...
                          May 8 04:18:23 daf3cfab8573 syslog-ng[10]: syslog-ng starting up; version='3.5.6'
                          May 8 04:18:23 daf3cfab8573 syslog-ng[10]: WARNING: you are using the pipe driver, underlying file is not a FIFO, it should be used by file(); filename='/dev/stdout'
                          May 8 04:18:24 daf3cfab8573 syslog-ng[10]: EOF on control channel, closing connection;
                          *** Running /etc/rc.local...
                          *** Booting runit daemon...
                          *** Runit started as PID 16
                          *** Running ps aux...
                          May 8 04:18:24 daf3cfab8573 cron[20]: (CRON) INFO (pidfile fd = 3)
                          May 8 04:18:24 daf3cfab8573 cron[20]: (CRON) INFO (Running @reboot jobs)
                          USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
                          root 1 5.0 0.0 32304 10796 ? Ss+ 04:18 0:00 /usr/bin/python3 -u /sbin/my_init ps aux
                          root 10 1.0 0.0 72364 7552 ? S 04:18 0:00 /usr/sbin/syslog-ng --pidfile /var/run/syslog-ng.pid -F --no-caps
                          root 16 0.0 0.0 4392 1124 ? S+ 04:18 0:00 /usr/bin/runsvdir -P /etc/service
                          root 17 0.0 0.0 37656 3340 ? R+ 04:18 0:00 ps aux
                          root 18 0.0 0.0 4240 672 ? Ss 04:18 0:00 runsv cron
                          root 19 0.0 0.0 4240 800 ? Ss 04:18 0:00 runsv sshd
                          root 20 0.0 0.0 29272 2840 ? S 04:18 0:00 /usr/sbin/cron -f
                          *** ps exited with status 0.
                          *** Shutting down runit daemon (PID 16)...
                          *** Running /etc/my_init.post_shutdown.d/10_syslog-ng.shutdown...
                          May 8 04:18:24 daf3cfab8573 syslog-ng[10]: syslog-ng shutting down; version='3.5.6'
                          May 8 04:18:24 daf3cfab8573 syslog-ng[10]: EOF on control channel, closing connection;
                          *** Killing all processes...





                          share|improve this answer













                          I figured out (from here) that the proper way to use the phusion/baseimage is to run it as -



                          docker run --rm -t -i phusion/baseimage /sbin/my_init ps aux`


                          to have my_init execute as PID1 and have my_init spawn a process for ps aux



                          *** Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
                          *** Running /etc/my_init.d/10_syslog-ng.init...
                          May 8 04:18:23 daf3cfab8573 syslog-ng[10]: syslog-ng starting up; version='3.5.6'
                          May 8 04:18:23 daf3cfab8573 syslog-ng[10]: WARNING: you are using the pipe driver, underlying file is not a FIFO, it should be used by file(); filename='/dev/stdout'
                          May 8 04:18:24 daf3cfab8573 syslog-ng[10]: EOF on control channel, closing connection;
                          *** Running /etc/rc.local...
                          *** Booting runit daemon...
                          *** Runit started as PID 16
                          *** Running ps aux...
                          May 8 04:18:24 daf3cfab8573 cron[20]: (CRON) INFO (pidfile fd = 3)
                          May 8 04:18:24 daf3cfab8573 cron[20]: (CRON) INFO (Running @reboot jobs)
                          USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
                          root 1 5.0 0.0 32304 10796 ? Ss+ 04:18 0:00 /usr/bin/python3 -u /sbin/my_init ps aux
                          root 10 1.0 0.0 72364 7552 ? S 04:18 0:00 /usr/sbin/syslog-ng --pidfile /var/run/syslog-ng.pid -F --no-caps
                          root 16 0.0 0.0 4392 1124 ? S+ 04:18 0:00 /usr/bin/runsvdir -P /etc/service
                          root 17 0.0 0.0 37656 3340 ? R+ 04:18 0:00 ps aux
                          root 18 0.0 0.0 4240 672 ? Ss 04:18 0:00 runsv cron
                          root 19 0.0 0.0 4240 800 ? Ss 04:18 0:00 runsv sshd
                          root 20 0.0 0.0 29272 2840 ? S 04:18 0:00 /usr/sbin/cron -f
                          *** ps exited with status 0.
                          *** Shutting down runit daemon (PID 16)...
                          *** Running /etc/my_init.post_shutdown.d/10_syslog-ng.shutdown...
                          May 8 04:18:24 daf3cfab8573 syslog-ng[10]: syslog-ng shutting down; version='3.5.6'
                          May 8 04:18:24 daf3cfab8573 syslog-ng[10]: EOF on control channel, closing connection;
                          *** Killing all processes...






                          share|improve this answer













                          share|improve this answer



                          share|improve this answer











                          answered May 8 at 4:25









                          Lord Loh.

                          71641128




                          71641128






















                               

                              draft saved


                              draft discarded


























                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f442441%2fhow-should-one-invoke-docker-to-take-care-of-the-pid-1-problem-with-zombie-proce%23new-answer', 'question_page');

                              );

                              Post as a guest













































































                              Popular posts from this blog

                              How to check contact read email or not when send email to Individual?

                              Displaying single band from multi-band raster using QGIS

                              How many registers does an x86_64 CPU actually have?