如何从Cloud Foundry上的私有存储库部署Docker镜像?

我推送了一个本地的Docker镜像

docker push bspartifact.artifactory.example.com/bspartifact:1.0 

到我的私人Docker中心。 我现在如何将该映像部署到Cloud Foundry? 回购利用用户名和密码进行基本authentication。 谢谢。

编辑:

尝试使用–docker-username标志会导致以下错误:

 Staging... Staging process started ... Failed to talk to docker registry: Get https://bspartifact.artifactory.example.com/v2/: dial tcp 10.xx.xxx.xxx:443: getsockopt: connection refused Failed to talk to docker registry: Get http://bspartifact.artifactory.example.com/v2/: dial tcp 10.xx.xxx.xxx:80: getsockopt: connection refused 

正如dorkper提到的 – 你必须使用cf CLI 6.28.0或更高版本。 但是您的Cloud Foundry提供商也应该支持这一点。 使用Cloud Foundry API版本2.82.0实现了推送Docker映像的function。 您可以使用cf api检查您的Cloud Foundry提供程序运行在哪个api版本上。

使用cf CLI 6.28.0或更高版本,运行cf push myapp -o bspartifact.artifactory.example.com/bspartifact:1.0 --docker-username myuser 。 这会提示你input密码。
对于非交互式使用,将环境属性CF_DOCKER_PASSWORD设置为您的密码,CLI将使用该属性。
有关详细信息,请参阅以下文档: http : //docs.cloudfoundry.org/devguide/deploy-apps/push-docker.html#private-repo