Private Repository

http://docs.rancher.com/os/configuration/private-registries/

#cloud-config
rancher:
registry_auths:
https://index.docker.io/v1/:
username: username
password: password

By using the write_files directive, you can add your login credentials so that when RancherOS boots, you will already by logged in.
#cloud-config
write_files:

  • path: /home/rancher/.docker/config.json
    permissions: “0755”
    owner: rancher
    content: |
    {
    “auths”: {
    https://index.docker.io/v1/”: {
    “auth”: “asdf=”,
    “email”: “not@val.id”
    }
    }
    }

Which version should be used? Looks like documentation is currently showing 2 different ways to configure docker registry. I wasn’t able to successfully use first one with RancherOs v0.5.0.

There are actually separate use cases for both of these.

The Docker client reads from /home/rancher/.docker/config.json, so the second method will configure authentication when running docker commands.

The first command will configure authentication for system services such as those in a cloud-config or those enabled with the ros command.

1 Like

Thanks! Makes sense!