Search code examples
dockercloud-foundryswisscomdev

Deploy a docker image from a registry with basic auth


I've been trying to push a docker image from a private registry to Swisscom Cloudfoundry. The registry is protected by basic auth since we do not want to provide access to anyone.

Now, using the cf CLI, I would like to push the image to cloudfoundry:

cf push appname -o my-registry.domain.com/image

Logically this will result in an error which states that no authentication credentials are provided.

cf push appname -o username:password@my-registry.domain.com/image

results in an unspecified error during staging.

Is there any way to push an image from a registry which is protected by Basic Auth via CF CLI?

I was not able to find anything in the CF CLI documentation.


Solution

  • cf push currently (version 6.26.0) does not support private docker registries.
    This feature is currently being added to the Cloud Controller. It is not even available yet in the latest CF release (v258) but the API is documented in the CC release candidate documentation: http://apidocs.cloudfoundry.org/release-candidate/apps/creating_a_docker_app.html
    You can use cf curl to call this API until cf push supports it.
    The CLI tracker story to follow is https://www.pivotaltracker.com/story/show/143540893.