简体   繁体   中英

How to pass Docker credentials to `docker.login` in Salt?

I am trying to use this code snippet to login to DockerHub in Salt:

docker.login
  module.run:
    - registries:
      - hub

How do I pass proper Docker credentials here so that the minion can login to DockerHub? Additionally I'll be using a Docker token to log-in since I have two-factor authentication enabled in the DockerHub account.

Everything is in the documentation :

You need to put this data in the minion config, its grains, or its pillar

docker-registries:
  hub:
    username: foo
    password: s3cr3t

And then a single call will login and cache your token

salt-call docker.login

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM