GoogleContainerTools / kaniko

Build Container Images In Kubernetes
Apache License 2.0
14.72k stars 1.43k forks source link

executor quits abruptly without any hint when doing "RUN apt-get install -y runit" #1188

Open wswfc opened 4 years ago

wswfc commented 4 years ago

Actual behavior executor quit without any hint when doing "RUN apt-get install -y runit"

Expected behavior executor should finish the build without error

To Reproduce Steps to reproduce the behavior:

  1. Use a Dockerfile with the following content:

    FROM ubuntu:16.04
    RUN apt-get update && apt-get install -y runit && echo done
  2. Use docker to run the container:

    docker run -it -v ~/Downloads/runit/Dockerfile:/workspace/Dockerfile gcr.io/kaniko-project/executor:v0.19.0 --dockerfile /workspace/Dockerfile --context dir:///workspace/ --destination test:latest --no-push
  3. The kaniko executor container will quit at:

    Unpacking runit (2.1.2-3ubuntu1) ...
    Setting up fgetty (0.7-1) ...
    Setting up runit (2.1.2-3ubuntu1) ...

Additional Information

What is weird is if I use the debug image and sh into the kaniko container, and launch the executor manually, the executor finished without any error. The last lines are:

Unpacking runit (2.1.2-3ubuntu1) ...
Setting up fgetty (0.7-1) ...
Setting up runit (2.1.2-3ubuntu1) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
done
INFO[0017] Taking snapshot of full filesystem...        
INFO[0017] Resolving paths                              
INFO[0017] Skipping push to container registry due to --no-push flag 

Triage Notes for the Maintainers

Description Yes/No
Please check if this a new feature you are proposing
  • - [ ]
Please check if the build works in docker but not in kaniko
  • - [x]
Please check if this error is seen when you use --cache flag
  • - [ ]
Please check if your dockerfile is a multistage dockerfile
  • - [ ]
tejal29 commented 4 years ago

@wswfc from the logs looks like there is some log lines. Do you expect to see more lines after this?

debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
wswfc commented 4 years ago

Hi @tejal29 ,

These log lines are printed by "apt-get install". In normal scenarios (using docker build or running the executor manually in the debug image shell) they are, and should be, displayed once (meaning the runit package is installed and configured successfully) and then the image is built without error.

In the failed case (using kaniko executor image to build) , these lines are never printed and no image is built. It seems the executor just quit while "apt-get install" is configuring the runit package.