File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,7 +19,9 @@ FROM nvidia/cuda:12.9.2-devel-ubuntu20.04
1919
2020ARG DEBIAN_FRONTEND=noninteractive
2121ARG TZ=Etc/UTC
22- ENV TZ=${TZ}
22+ ENV DEBIAN_FRONTEND=${DEBIAN_FRONTEND} \
23+ DEBCONF_NONINTERACTIVE_SEEN=true \
24+ TZ=${TZ}
2325
2426# Make long ROS / Ubuntu apt transactions less fragile in Docker builds.
2527# This helps with transient mirror/network errors such as failed downloads
@@ -62,11 +64,15 @@ ENV LANG=en_US.UTF-8 \
6264 LC_ALL=en_US.UTF-8
6365
6466# Create the install user with passwordless sudo. The installer uses
65- # sudo for system-level steps (apt, rosdep init); NOPASSWD keeps it
66- # non-interactive during the image build.
67+ # sudo for system-level steps (apt, rosdep init). Preserve the noninteractive
68+ # debconf environment through sudo so package configuration cannot block
69+ # Docker builds with prompts such as keyboard layout selection.
6770RUN groupadd --gid ${USER_GID} ${USERNAME} \
6871 && useradd --uid ${USER_UID} --gid ${USER_GID} -m -s /bin/bash ${USERNAME} \
69- && echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/${USERNAME} \
72+ && { \
73+ echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" ; \
74+ echo 'Defaults env_keep += "DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN TZ"' ; \
75+ } > /etc/sudoers.d/${USERNAME} \
7076 && chmod 0440 /etc/sudoers.d/${USERNAME}
7177
7278USER ${USERNAME}
You can’t perform that action at this time.
0 commit comments