Pushing Docker images to MicroPCF


Nanduni Nimalsiri
 

Hi,

Is there any way to push a Dockerfile and start an application instead of pushing a publicly available docker image in Cloud Foundry. The problem is that I want to run some Docker images on Cloud Foundry, but they are not publicly available in Docker Hub. How can I proceed with this.

If I explain this scenario briefly, what I want is to deploy the artifacts[1] in MicroPCF or in Diego in Bosh-Lite. How can I run them? Can you please help.
[1]https://github.com/wso2/kubernetes-artifacts

Best regards,
Nanduni.


Will Pragnell <wpragnell@...>
 

Hi Nanduni,

Currently there's no way to push a Dockerfile that I'm aware of. Your best
bet (assuming you can't push your image to Docker Hub) is to run a Docker
registry locally. This can be done fairly easily using the Registry image
[1]. You may even be able to run the registry on MicroPCF temporarily
(remember containers on CF are ephemeral and can't persist state to disk),
which would be kinda neat!

There's one other thing, though. By default, CF can't pull docker images
from registries that are using self signed certificates. Garden-Linux (the
container running part of CF) has a list of registries that are allowed to
break this rule (configured using the `insecure_docker_registry_list`
property [2]) so you'll need to add the address of your registry to that.
I'm afraid I don't know how to set this for MicroPCF though. Hopefully
someone more familiar with MicroPCF can advise on that.

Good luck!
Will

[1]: https://hub.docker.com/_/registry
[2]:
https://github.com/cloudfoundry-incubator/garden-linux-release/blob/master/jobs/garden/spec#L89

On 17 February 2016 at 09:36, Nanduni Nimalsiri <nandunibw(a)gmail.com> wrote:

Hi,

Is there any way to push a Dockerfile and start an application instead of
pushing a publicly available docker image in Cloud Foundry. The problem is
that I want to run some Docker images on Cloud Foundry, but they are not
publicly available in Docker Hub. How can I proceed with this.

If I explain this scenario briefly, what I want is to deploy the
artifacts[1] in MicroPCF or in Diego in Bosh-Lite. How can I run them? Can
you please help.
[1]https://github.com/wso2/kubernetes-artifacts

Best regards,
Nanduni.


Nanduni Nimalsiri
 

Hi Will,

Thank you very much for the detailed information. You have cleared lots of doubts that I had been struggling with. Actually I have an internal private docker registry for this scenario. If I do this task with Diego in Bosh-Lite and that private docker registry, can you please explain me how I should list the registry's address in 'spec' which you have mentioned.

In this context, what is meant by 'IP:PORT tuples and CIDR subnet masks'? I know the address of the private registry so that I can do a docker login and give credentials for docker login.

Should I clone the 'cloudfoundry-incubator/garden-linux-release' and follow its README? Please explain me how I should proceed with this task. Looking forward for your help.

Best Regards,
Nanduni


Will Pragnell <wpragnell@...>
 

Hi Nanduni,

When you deploy CF to bosh-lite, you generate a manifest which contains
properties for the various jobs that get deployed.

In the manifest (big yaml file) for the Diego deployment, there should be
some properties under a key `garden`. You can edit this manifest, adding a
new property there, and then redeploy to update your deployment.

An IP:PORT tuple in this context is something like "127.0.0.1:8080", so if
you know the IP and port (default for Docker registries is generally 5000 I
think) of your registry then you can just set this as `[ "<MY REGISTRY
IP>:5000" ]`. I'm not sure whether DNS is supported here I'm afraid, though
it may work, so give it a try if you don't just have an IP to work with.

You mention credentials. I'm afraid there's another limitation I should
point out: CF doesn't currently support pulling Docker images from private
repositories (repositories that require a password to access). If your
local repo on your internal registry requires this, you won't be able to
pull the image directly into CF.

Hope this helps. If the BOSH properties part doesn't make sense, then I'd
recommend checking out http://mariash.github.io/learn-bosh to become more
familiar with BOSH.

Best,
Will

On 18 February 2016 at 05:46, Nanduni Nimalsiri <nandunibw(a)gmail.com> wrote:

Hi Will,

Thank you very much for the detailed information. You have cleared lots of
doubts that I had been struggling with. Actually I have an internal private
docker registry for this scenario. If I do this task with Diego in
Bosh-Lite and that private docker registry, can you please explain me how I
should list the registry's address in 'spec' which you have mentioned.

In this context, what is meant by 'IP:PORT tuples and CIDR subnet masks'?
I know the address of the private registry so that I can do a docker login
and give credentials for docker login.

Should I clone the 'cloudfoundry-incubator/garden-linux-release' and
follow its README? Please explain me how I should proceed with this task.
Looking forward for your help.

Best Regards,
Nanduni


Nanduni Nimalsiri
 

Thank you very much. I will try your instructions.

Best regards,
Nanduni