Skip to content

option to start a local docker registry #1600

@superewald

Description

@superewald

Is your feature request related to a problem? Please describe.
I have several projects that build containers within the gitlab ci workflow. Some of them use the gitlab registry (in particular the $CI_REGISTRY, $CI_REGISTRY_USER and $CI_REGISTRY_PASSWORD variables) to push and pull specific layers to implement some kind of "caching".

Describe the solution you'd like
A cli option for gitlab-ci-local which will start a local docker registry and populate the $CI_REGISTRY variable to all gitlab-ci-local managed containers.
For eg. gitlab-ci-local --registry would

  • start a https://hub.docker.com/_/registry container
  • add an override for $CI_REGISTRY variable for other containers
  • execute gitlab-ci-local main logic/pipelines
  • stop the registry container before exiting

Describe alternatives you've considered
As described in the docker-in-docker-build-with-local-registry example, it is currently required to start and stop a local docker registry manually. That is inconvenient as gitlab-ci-local should not require additional setup commands to run for cases which are supported by the original gitlab-runners in my opinion.
Also it makes scripting with gitlab-ci-local a bit more verbose and adds a source of failure.

Additional Context
I'm using buildah and podman but the same scenario should apply to docker afaik.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureFeature missing according to gitlab ci standard

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions