docker: add apt-get upgrade to all Dockerfiles#45384
docker: add apt-get upgrade to all Dockerfiles#45384vincentkoc merged 4 commits intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR adds
Confidence Score: 4/5
Prompt To Fix All With AIThis is a comment left during a code review.
Path: Dockerfile
Line: 135
Comment:
**`DEBIAN_FRONTEND` not set for `apt-get upgrade`**
`DEBIAN_FRONTEND=noninteractive` is applied to the subsequent `apt-get install` but not to `apt-get upgrade -y`. If any upgraded package triggers a `debconf` configuration dialog (e.g., a timezone or locale package), the build will hang because Docker's build context has no interactive terminal. The sandbox Dockerfiles avoid this by exporting `DEBIAN_FRONTEND` as an `ENV` variable that covers all commands in the layer.
```suggestion
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: Dockerfile
Line: 135
Comment:
**`--no-install-recommends` missing from `apt-get upgrade`**
All eight Dockerfiles pass `--no-install-recommends` to `apt-get install` to keep image layers minimal, but the newly added `apt-get upgrade -y` lines do not carry the same flag. When upgrading packages apt may pull in new recommended packages that weren't previously present, silently growing the image size.
This affects all changed files:
- `Dockerfile` line 135
- `Dockerfile.sandbox` line 10
- `Dockerfile.sandbox-browser` line 10
- `Dockerfile.sandbox-common` line 27
- `scripts/docker/cleanup-smoke/Dockerfile` line 8
- `scripts/docker/install-sh-e2e/Dockerfile` line 8
- `scripts/docker/install-sh-nonroot/Dockerfile` line 14
- `scripts/docker/install-sh-smoke/Dockerfile` line 14
For consistency with the rest of each `RUN` layer, consider adding `--no-install-recommends`:
```suggestion
apt-get upgrade -y --no-install-recommends && \
```
How can I resolve this? If you propose a fix, please make it concise.Last reviewed commit: 71a12da |
…grade Prevents debconf hangs during Docker builds and avoids pulling in recommended packages that silently grow the image. Co-Authored-By: Claude <[email protected]>
…t-get upgrade" This reverts commit 6fc3839.
…grade Prevents debconf hangs during Docker builds and avoids pulling in recommended packages that silently grow the image. Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c39a031e37
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| RUN --mount=type=cache,id=openclaw-bookworm-apt-cache,target=/var/cache/apt,sharing=locked \ | ||
| --mount=type=cache,id=openclaw-bookworm-apt-lists,target=/var/lib/apt,sharing=locked \ | ||
| apt-get update && \ | ||
| DEBIAN_FRONTEND=noninteractive apt-get upgrade -y --no-install-recommends && \ |
There was a problem hiding this comment.
Avoid upgrading pinned base packages during image build
Running apt-get upgrade here makes rebuilds of the same Git SHA depend on whatever package versions are live in Debian/Ubuntu mirrors at build time, so identical source revisions no longer produce identical images. In this repo that conflicts with the stated reproducibility contract for pinned base digests (Dockerfile:22), and it can cause release/provenance drift and hard-to-debug cache misses across CI runs; prefer bumping pinned base-image digests (or using snapshot repos) instead of upgrading in the Docker build.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Ensuring packages are up to date means the container has the latest security fixes, this is more important that container reproducibility for each git SHA.
* docker: add apt-get upgrade to patch base-image vulnerabilities Closes openclaw#45159 * docker: add DEBIAN_FRONTEND and --no-install-recommends to apt-get upgrade Prevents debconf hangs during Docker builds and avoids pulling in recommended packages that silently grow the image. Co-Authored-By: Claude <[email protected]> * Revert "docker: add DEBIAN_FRONTEND and --no-install-recommends to apt-get upgrade" This reverts commit 6fc3839. * docker: add DEBIAN_FRONTEND and --no-install-recommends to apt-get upgrade Prevents debconf hangs during Docker builds and avoids pulling in recommended packages that silently grow the image. Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
* docker: add apt-get upgrade to patch base-image vulnerabilities Closes openclaw#45159 * docker: add DEBIAN_FRONTEND and --no-install-recommends to apt-get upgrade Prevents debconf hangs during Docker builds and avoids pulling in recommended packages that silently grow the image. Co-Authored-By: Claude <[email protected]> * Revert "docker: add DEBIAN_FRONTEND and --no-install-recommends to apt-get upgrade" This reverts commit 6fc3839. * docker: add DEBIAN_FRONTEND and --no-install-recommends to apt-get upgrade Prevents debconf hangs during Docker builds and avoids pulling in recommended packages that silently grow the image. Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
Summary
apt-get upgrade -ybeforeapt-get installin all 8 Dockerfiles that install system packages from a base imageFiles changed
Dockerfile(runtime stage)Dockerfile.sandboxDockerfile.sandbox-browserDockerfile.sandbox-commonscripts/docker/cleanup-smoke/Dockerfilescripts/docker/install-sh-e2e/Dockerfilescripts/docker/install-sh-nonroot/Dockerfilescripts/docker/install-sh-smoke/DockerfileCloses #45159
Test plan
docker build .completes successfully🤖 Generated with Claude Code