Hello,
Due to the Docker Hub rate limitation, we are forced to copy the common images (like python image) to our private container registry. However, I can't find a way to efficiently login to the private registry in the Dagger engine.
I saw the documentation about Custom Registry Mirrors but it doesn't include any information about authentication so I suppose it is not where I'll find my solution.
I'm deploying the dagger pipelines on Kubernetes in the following way:
- Init container: run the
docker logincommand to generate the file in/root/.docker/config.jsonhaving the authentication to the private container registry - Sidecar: Dagger engine where I mount the same volume containing the at
/root/.docker(I verified, the file is here and contains the authentication to the private registry) - Main container: Dagger client running my
dagger call ...command to run the pipeline.
Here is a very simplified version of my pod YAML. Everything is running fine, until the moment I try to pull a image from my registry.
volumes:
- name: dagger-socket
emptyDir: {}
- name: docker-configuration
emptyDir: {}
templates:
initContainers:
- name: dind-login
image: docker:27-rc
command:
- sh
- -c
- "docker login <registry_url> -u <username> -p <password>"
volumeMounts:
- mountPath: /root/.docker
name: docker-configuration
sidecars:
- name: dagger-engine
image: "registry.dagger.io/engine:v0.14.0"
volumeMounts:
- mountPath: /var/run/buildkit
name: dagger-socket
- mountPath: /root/.docker
name: docker-configuration
containers:
- image: alpine:latest
command:
- sh
- -c
- "dagger call ..."
env:
- name: "_EXPERIMENTAL_DAGGER_RUNNER_HOST"
value: "unix:///var/run/dagger/buildkitd.sock"
volumeMounts:
- mountPath: /var/run/dagger
name: dagger-socket