Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deploy a Docker image from a private repository on Cloud Foundry?

I pushed a local Docker image with

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

to my private Docker hub. How can I now deploy that image to Cloud Foundry? The repo is secured by a basic authentication with username and password. Thanks.

Edit:

Trying the --docker-username flag results in the following error:

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
like image 502
jz22 Avatar asked Jul 19 '17 11:07

jz22


2 Answers

Using cf CLI 6.28.0 or higher, run cf push myapp -o bspartifact.artifactory.example.com/bspartifact:1.0 --docker-username myuser. This will prompt you for your password.
For non-interactive use, set environment property CF_DOCKER_PASSWORD to your password and the CLI will use that.
Refer to the following documentation for details: http://docs.cloudfoundry.org/devguide/deploy-apps/push-docker.html#private-repo

like image 195
dkoper Avatar answered Sep 18 '22 13:09

dkoper


As mentioned from dkoper - you have to use cf CLI 6.28.0 or higher. But your Cloud Foundry provider should also support this. The feature to push docker images was implemented with Cloud Foundry api version 2.82.0. You can check on which api version your Cloud Foundry provider is running with cf api.

like image 38
Rumpli Avatar answered Sep 18 '22 13:09

Rumpli