-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switching to a bare-based image will reduce the overall image size and reduces attack surface area. The original Dockerfile uses gcr.io/distroless/static:nonroot, which has only a few packages. We can add those packages and switch to a bare-based image. Additionally, the original image is a non-root image, thus, we should also switch our rock to be non-root. We can no longer use ensure_image_contains_paths to check if files exist in the rock images, since they are now bare-based. Instead, we can use ensure_image_contains_paths_bare, which checks the image layers instead. Because of this, we need sufficient permissions to check the /var/lib/docker folder.
- Loading branch information
1 parent
c5526f5
commit 9da5dc9
Showing
3 changed files
with
23 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,9 @@ description: > | |
version: v0.30.0 | ||
license: Apache-2.0 | ||
|
||
base: [email protected] | ||
base: bare | ||
build-base: [email protected] | ||
run-user: _daemon_ | ||
platforms: | ||
amd64: | ||
|
||
|
@@ -19,6 +20,22 @@ services: | |
startup: enabled | ||
|
||
parts: | ||
add-base-packages: | ||
plugin: nil | ||
stage-packages: | ||
# Original Dockerfile uses gcr.io/distroless/static:nonroot as a base. | ||
# This image contains the following: | ||
# https://github.com/GoogleContainerTools/distroless/blob/1533e54a73805ec13fe0cc68218fc7a215a0a6f7/base/README.md | ||
- ca-certificates | ||
- tzdata | ||
- base-passwd | ||
|
||
# Can't have stage packages and stage slices together, apparently. | ||
add-base-slices: | ||
plugin: nil | ||
stage-packages: | ||
- base-files_tmp | ||
|
||
build-deps: | ||
plugin: nil | ||
build-snaps: | ||
|