I have a Dockerfile that builds with “docker build” but not with kaniko on a Debian 12 image.
The offending line is (gnupg fails like this too):
RUN apt-get install -y gnupg2
When using Docker build the setting up of pinentry-curses goes to the next line – no problem:
Setting up pinentry-curses (1.2.1-1) ...
Setting up libreadline8:amd64 (8.2-1.3) …
When using a Kaniko build:
Setting up pinentry-curses (1.2.1-1) ...
alternatives version 1.7.6 - Copyright (C) 2001 Red Hat, Inc.
This may be freely redistributed under the terms of the GNU Public License.
usage: alternatives --install <link> <name> <path> <priority>
[--initscript <service>]
[--family <family>]
[--slave <link> <name> <path>]*
alternatives --remove <name> <path>
alternatives --auto <name>
alternatives --config <name>
alternatives --display <name>
alternatives --set <name> <path>
alternatives --list
common options: --verbose --test --help --usage --version --keep-missing
--altdir <directory> --admindir <directory>
dpkg: error processing package pinentry-curses (--configure):
What’s going on? It appears like the Docker version might have answered a configuration question, so I tried things like this:
RUN echo "pinentry-curses pinentry/curses/default boolean true" | debconf-set-selections
I’m not sure that was the right command. I also tried export DEBIAN_FRONTEND=noninteractive;
before the install command (and a few dozen other things).
What is Docker doing that Kaniko is not doing? Is it possible to create an image with Kaniko if you want to install gnupg or gnupg2?