Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace scratch base image with distroless static #833

Closed
szucsitg opened this issue Feb 17, 2022 · 6 comments · Fixed by #1106
Closed

Replace scratch base image with distroless static #833

szucsitg opened this issue Feb 17, 2022 · 6 comments · Fixed by #1106
Assignees
Labels
enhancement New feature or request

Comments

@szucsitg
Copy link

What would you like to be added:
I'd like to change the base image to distroless static from scratch. And also publish a debug version.

Why is this needed:
For GitLab CI the presence of shell is needed for Kubernetes based runners. If the project would publish such images, there could be easily a variant for debug image, that would contain shell. It is the approach that other project followed that runs on top of shell-less images, e.g. kaniko.

Additionally it'd save manually copying CA certificates during image build, as currently present in Dockerfile. The image size difference would be negligible with distroless static base image.

Additional context:
If you agree with the approach, I'm happy to contribute this.

@szucsitg szucsitg added the enhancement New feature or request label Feb 17, 2022
@luhring
Copy link
Contributor

luhring commented Feb 17, 2022

This sounds interesting!

For GitLab CI the presence of shell is needed for Kubernetes based runners.

Could you explain why this is? I'm trying to wrap my head around it

@szucsitg
Copy link
Author

I can only point to some sparse documentation around this:
https://docs.gitlab.com/runner/executors/kubernetes.html#container-entrypoint
https://docs.gitlab.com/ee/ci/docker/using_kaniko.html#building-a-docker-image-with-kaniko --> "a shell is required for an image to be used with GitLab CI/CD"

I think the design decision was that they assumed most of the time you want to issue more than one command in a CI step, and it helped them to keep the existing syntax. Also it's quite the norm to have shell in images, regardless I do not agree with such deployments in production.

@npalladium
Copy link

This is something that would interest me as well.

@stexandev
Copy link

Actually, this is keeping us from integrating syft into our (gitlab) ci pipelines. Go for it!

@wagoodman
Copy link
Contributor

I think internally we're leaning towards adding another docker build for the distroless-static debug variant (and leaving the existing image as is, using static).

@spiffcs spiffcs self-assigned this Jul 8, 2022
@spiffcs
Copy link
Contributor

spiffcs commented Jul 8, 2022

I'll get this new distroless image added to the manifest

spiffcs added a commit that referenced this issue Jul 20, 2022
add debug distroless image to published release

Debian was chosen based on the fact that it is the smallest available distroless image
The new tag is `anchore/syft:debug`

Closes #833
aiwantaozi pushed a commit to aiwantaozi/syft that referenced this issue Oct 20, 2022
add debug distroless image to published release

Debian was chosen based on the fact that it is the smallest available distroless image
The new tag is `anchore/syft:debug`

Closes anchore#833
GijsCalis pushed a commit to GijsCalis/syft that referenced this issue Feb 19, 2024
add debug distroless image to published release

Debian was chosen based on the fact that it is the smallest available distroless image
The new tag is `anchore/syft:debug`

Closes anchore#833
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants