Drone on native kubernetes private registry login

Hi,
How do I download private images/repo when running on native kubernetes, I tried to set the
image_pull_secrets:

  • dockerconfigjson

but the thing is my session is valid only for 12 hours and I tried to do a step on drone to do docker login but I am getting the following error:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

I running on Native kubernetes without any agent

I put on my Yaml
volumes:

  • name: docker-vol
    host:
    path: /var/run/docker.sock

buts it not working

kind: pipeline
name: default

platform:
os: linux
arch: amd64

steps:

  • name: pull
    image: docker:dind
    environment:
    XXXX:
    from_secret: XXXX
    XXXX:
    from_secret: XXXX
    commands:

volumes:

  • name: docker-vol
    host:
    path: /var/run/docker.sock

does someone aware to this situation?

If your session is only available for 12 hours you need to create a registry plugin that is able to refresh your credentials. Registry plugins provide on-demand docker credentials to your pipeline without having to use image_pull_secrets. You can see examples of registry plugins to learn more bout them here:

Both of the above registry credential plugins support ECR which has a 12 hour expiration for credentials. So you should be able to study these plugins and create something similar that works with your registry provider.