GitLab instance: gitlab.com
GitLab runner: shared @ v13.8.0 (775dd39d)
I would like to use the Symfony CLI to run their security checker command in a CI/CD pipeline. This page describes how to do that with the official Docker image: https://symfony.com/blog/the-php-security-checker-as-a-docker-image.
docker run --rm -v $(pwd):$(pwd) -w $(pwd) symfonycorp/cli check:security
Now, to run this in a CI/CD pipeline I tried the following .gitlab-ci.yml file:
image: gitlab/dind:latest stages: - check security-checker: stage: check image: symfonycorp/cli script: - check:security
The step fails with the following error:
Executing "step_script" stage of the job script Command "sh" does not exist. Did you mean one of these? env:ssh local:php:refresh ssh
I suspect this is because this image defines a custom entrypoint:
The “sh does not exist” error pops up quite a lot of times on GitLab community, I already tried the following things that were suggested but none of them work:
Trying to put /symfony in front (to try to prevent the runner from using /sh)
script: - /symfony check:security
Just attempting to echo anything:
script: - echo "TEST"
Resetting the entry point to “”:
image: name: symfonycorp/cli entrypoint: [""]
And then explicitly set the entrypoint:
image: name: symfonycorp/cli entrypoint: ["/symfony"] # I think this doesn't have any effect since the image already defines this
Can anyone help me to run an image like this with a predefined entrypoint?
Thanks in advance!