Issue
When building a docker file, even with the ENV DEDIAN_FRONTEND=noninteractive
, apt-get install r-base
still prompts the following user inputs that prevent the automatic build process. Is there any way to disable these user inputs? Or, setting them through a config
file?
The minimal Dockerfile
is
# Use an official Ubuntu runtime as a parent image
FROM ubuntu:24.04
# Set environment variable to avoid interactive prompts
ENV DEBIAN_FRONTEND=noninteractive
# Update the package lists and install a package without prompts
RUN apt-get update \
&& apt-get install -y r-base
I tried on macOS(m1) with Docker version 25.0.1 and macOS(intel) with Docker version 20.10.17.
Solution
Just add --no-install-recommends I believe.
# Use an official Ubuntu runtime as a parent image
FROM ubuntu:24.04
# Set environment variable to avoid interactive prompts
ENV DEBIAN_FRONTEND=noninteractive
# Update the package lists and install a package without prompts and recommends
RUN apt-get update && apt-get install -y --no-install-recommends r-base
Plus I would suggest to use rocker (R image for docker) in general
# Base R image
FROM rocker/r-ver
#easier and less hussle
Answered By - David Muñoz Tord Answer Checked By - Marilyn (WPSolving Volunteer)