syft: Unable to use Syft from GitLab CI/CD

What happened:

GitLab utilizes shells of container images to run CI/CD jobs. The Syft container doesn’t not provide any shells. While the distroless images do provide a focused base image for CLI images it prevents Syft from being used by all CI/CD platforms where it is intended.

What you expected to happen:

GitLab should be able to utilize a shell and perform any additional pre/post setup actions for Syft.

Steps to reproduce the issue:

Create a project with a pipeline on GitLab.com (or any CI/CD utilizing shells) and attempt to use syft:

image:
  name: docker.io/anchore/syft:v0.82.0
  entrypoint: ''

Anything else we need to know?: https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#override-the-entrypoint-of-an-image https://github.com/anchore/syft/issues/833 https://github.com/anchore/grype/issues/1335

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 17 (11 by maintainers)

Most upvoted comments

👋 @kuwv check this repo out - it’s a basic example on how to use gitlab with the debug image

https://gitlab.com/spiffcs/gitlab-ci-playground/-/blob/main/.gitlab-ci.yml?ref_type=heads

I followed this documentation here: https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#override-the-entrypoint-of-an-image

Job output for the above ci confiruration using /syft alpine:latest: image

I can reopen this issue if you need more help, but just wanted to post the verification that our debug image works as intended with the provided distroless shell