Skip to content

Conversation

claudiubelu
Copy link
Contributor

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.

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.
Copy link
Collaborator

@bschimke95 bschimke95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bschimke95 bschimke95 merged commit 8753654 into canonical:main Nov 5, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants