Skip to content

enhancement: add build check for uses of DEBIAN_FRONTEND in Dockerfiles #6510

@thaJeztah

Description

@thaJeztah

Description

related:

When building images on debian-based distributions, there used to be issues with installing some packages when running non-interactively; some packages could ask for user-input, and "hang" when run as part of a Dockerfile. At some point we therefore added recommendations in our docs / FAQ to set DEBIAN_FRONTEND=noninteractive for those commands. Some users did so using ENV, which was problematic; we added a warning for this situation in our docs in moby/moby@2bbf875

Note that setting "ENV DEBIAN_FRONTEND=noninteractive" may cause
unintended consequences, because it will persist when the container is run
interactively, as with the following command: docker run -t -i image bash

But once ARG was introduced, which does not persist in the image, users started to use ARG DEBIAN_FRONTEND=noninteractive.

Note that using DEBIAN_FRONTEND=noninteractive is no longer needed for current Debian (and Ubuntu) versions, so using this workaround is now obsolete.

Perhaps we should introduce a linter / check for these, and produce a warning;

  • if ENV DEBIAN_FRONTEND=noninteractive is used (for reasons outlined above)
  • possibly also for ARG DEBIAN_FRONTEND (either with, or without value), as this workaround is obsolete (unless using an old version of Debian or Ubuntu).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions