0

I'm attempting to build a docker container which includes qttools5-dev. Here's a snippet of the Dockerfile:

SHELL ["/bin/bash", "-c"]
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \ 
 && sudo apt-get install -y qttools5-dev

When I try to install qttools5-dev (not in the docker), it requires input to choose the keyboard (I have to press Enter, then 30, then 1 to choose English UK standard). I would like to avoid this process when installing in the docker, which is why I added the noninteractive env. However this installation seems to ignore that, so the container build gets stuck waiting for input here:

RUN sudo apt-get install -y qttools5-dev       163.7s 
 => => #   95. Ukrainian                                                        
 => => #   96. Urdu (Pakistan)                                                  
 => => #   97. Uzbek                                                            
 => => #   98. Vietnamese                                                       
 => => #   99. Wolof     

How do I avoid this? I'm happy to use some default setting, though ideally I'd like to set it to the UK keyboard. The simplest workaround is fine by me.

base12
  • 111

1 Answers1

1

The cause of this issue was keyboard-configuration not respecting DEBIAN_FRONTEND=noninteractive. I've managed to solve the issue using part of this answer. Namely, I've added the following to my Dockerfile:

RUN apt-get update \ 
 && sudo apt-get install -y debconf-utils
RUN echo "keyboard-configuration    keyboard-configuration/layout   select  English (UK)" | sudo debconf-set-selections
RUN echo "keyboard-configuration    keyboard-configuration/layoutcode   select  gb" | sudo debconf-set-selections
RUN echo "keyboard-configuration    keyboard-configuration/variant  select  English (UK)" | sudo debconf-set-selections
RUN apt-get update \ 
&& apt-get install -y keyboard-configuration \
    qttools5-dev
base12
  • 111