Conversation
- Add runtime-base and runtime-nonroot stages with USER 65534:65534 in Dockerfile - Keep default runtime stage for backwards compatibility (:latest and :debian remain root) - Add image-alpine-nonroot and image-debian-nonroot bake targets in docker-bake.hcl - Document non-root tags in README.md Closes wait4x#510
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Addresses #510. Adds dedicated non-root container image variants for both Alpine and Debian running as
65534:65534(nobody:nobody), providing out-of-the-box compliance for Kubernetes and security scanners like Trivy (CIS Docker 4.1 / DS-0002).Implementation Details
runtime-baseand introducesruntime-nonrootwithUSER 65534:65534.runtimestage inherits fromruntime-base, ensuring backwards compatibility so that default builds (:latestand:debian) continue running as root.target = "runtime"in_common.image-alpine-nonrootandimage-debian-nonrootbake targets targetingruntime-nonroot.image-alland definesimage-nonrootshortcut.wait4x/wait4x:nonrootandwait4x/wait4x:debian-nonroottags.CI Workflow Configuration (.github/workflows/ci.yaml)
Due to GitHub PAT security restrictions on modifying
.github/workflows/from personal access tokens without theworkflowscope, the following additions can be directly added toci.yaml:Closes #510.