Missing zypper non-interactive option

Handle zypper confirmation prompts and check automated build results.

Description

zypper install may wait for confirmation when user input is required. In an automated Docker build, this can leave the build waiting or cause it to fail.

Container images should build without manual intervention. Use a non-interactive option to handle confirmation prompts. It does not resolve package or repository errors or guarantee installation success.

Potential impact

  • An image build can stop or fail partway through.
  • CI/CD deployment can be delayed.
  • Differences between environments can make builds less reproducible.

Remediation

  • Use a non-interactive option, as in zypper install -y ....
  • Include package-cache cleanup in the build step.
  • Check automated builds for commands that require user input.

Examples

These excerpts assume a root build step in a SUSE-based image with zypper and repositories configured. Check that the curl package is available and that installation succeeds.

Before

dockerfile
RUN zypper install curl && zypper clean

After

dockerfile
RUN zypper install -y curl && zypper clean

Explanation:

  • Before: A confirmation prompt can interrupt the build.
  • After: -y requests non-interactive installation. Check failure exit codes and additional requirements such as licenses.

References