Best Practice¶
Overview¶
First of all, we highly discourage setting DEBIAN_FRONTEND to noninteractive via ENV. Because the environment variable persists after the build, e.g. when you run docker exec -it … bash. The setting would not make sense here.
Here are the two possible ways:
Setting it via ARG as this is only available during build:
ARG DEBIAN_FRONTEND=noninteractive RUN apt-get -qq install {your-package} When required, setting it on-the-fly.
RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get -qq install {your-package}
Reference¶
https://bobcares.com/blog/debian_frontendnoninteractive-docker/