官网在
Using a Private Docker Registry
其实很简单,私仓信息会存在本地的~/.docker目录。把这个目录打成tar.gz的包,然后在marathon配置的时候指定一下就可以了。详见:
1 Tar/Gzip credentials
1 2 3 4
| docker login some.docker.host.com Username: foo Password: Email: foo@bar.com
|
1 2
| cd ~ tar czf docker.tar.gz .docker
|
2.Mesos/Marathon config
增加一个到认证信息的uris就可以了:
1 2 3
| "uris": [ "file:///etc/docker.tar.gz" ]
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| { "id": "/some/name/or/id", "cpus": 1, "mem": 1024, "instances": 1, "container": { "type": "DOCKER", "docker": { "image": "some.docker.host.com/namespace/repo", "network": "HOST" } }, "uris": [ "file:///etc/docker.tar.gz" ] }
|
urls在图形界面里面有,当然你也可以手动编辑json文件,有语法错误他会提示你.