cherrypick #62666#62717
Conversation
add apt-get update for slim base Signed-off-by: Lonnie Liu <95255098+aslonnie@users.noreply.github.com>
There was a problem hiding this comment.
Code Review
This pull request modifies the docker/base-slim/Dockerfile to include apt-get upgrade -y and sets the DEBIAN_FRONTEND environment variable to noninteractive. The review feedback highlights that using apt-get upgrade in Dockerfiles is discouraged because it leads to non-deterministic builds and increased image size. Additionally, the feedback points out a missing DEBIAN_FRONTEND export in one section, which could cause the build to hang during interactive package configurations.
| ) | ||
|
|
||
| apt-get update | ||
| apt-get upgrade -y |
There was a problem hiding this comment.
The pull request description mentions adding apt-get update, but that command is already present on line 40. This change adds apt-get upgrade, which is generally discouraged in Dockerfiles. It makes builds non-deterministic because the image content will vary depending on when the build is run and what updates are available in the package repositories at that time. It also increases image size.
Additionally, unlike the change at line 148, this section is missing export DEBIAN_FRONTEND=noninteractive. Without it, apt-get upgrade or apt-get install might hang if a package requires interactive configuration.
| export DEBIAN_FRONTEND=noninteractive | ||
|
|
||
| apt-get update -y | ||
| apt-get upgrade -y |
add apt-get update for slim base