Closed danstoner closed 4 months ago
To pitch in on this, we were actually considering this package, but the main limiter for us has been the fact that our customer base (developers) would be running stale images for a while. We would prefer to be able to mention something in the configuration to pull always and use the CLI to deactivate that feature when needed (e.g. --no-pull).
I do not care about the gitlab job definition support, it's really about the tooling of gitlab-ci-local that we would want it to be configurable.
I will start working on a --image-pull-policy
command line option.
I would make it a --pull
and/or --no-pull
option that would also be configurable (default to "pull"? )
Just a recommendation based on my experience, take it with a grain of salt ;)
https://github.com/firecow/gitlab-ci-local/blob/master/src/index.ts#L202
I have used the same terms that gitlab does --pull-policy=always
or --pull-policy=if-not-present
(default, until 5.x.x)
Is your feature request related to a problem? Please describe.
I had an old version of a docker image on my computer that had been pulled previously. Running the job via
gitlab-ci-local
failed because the current pipeline was no longer compatible with the contents of the old image. Docker's default behavior is to only pull the image if it is 'missing'.By manually forcing the pull of the
latest
image locally withdocker pull
I was able to resolve the issue, but I had to go digging around in the pipeline code to find which image our pipeline was using. This is bound to happen again in the future. This is not a great experience for my developers and requires having to know the internals of the pipeline (rather than just using it).Describe the solution you'd like
It would be nice if
gitlab-ci-local
supported imagepull_policy
. This way we could set it to 'always' and avoid developers having stale images.Our current dev deploy pipeline specifies an image:
Possible future:
Describe alternatives you've considered
gitlab-ci-local
could itself always run pull before run via its standard command-line option:or maybe allow an environment variable to be set to control that behavior.
Speaking of environment variables, I could not find a DOCKER_ environment variable to control this behavior from outside gitlab-ci-local.
Additional context
Here are some links to GitLab docs and discussion on their addition of the
pull_policy
feature:https://docs.gitlab.com/ee/ci/yaml/?query=pull_policy#imagepull_policy
https://gitlab.com/gitlab-org/gitlab/-/issues/21619