che icon indicating copy to clipboard operation
che copied to clipboard

How do I deploy Eclipse Che with a custom version of the Che image?

Open AmitChameides opened this issue 7 years ago • 8 comments

Summary

Hey all, I'm trying to set up Eclipse Che on OpenShift in an enterprise environment which requires me to make some changes with the Che pod prior to deployment. I made a custom Che image (That is, I built an image using the GitHub project's filed with a slightly altered Che Dockerfile). I also turned it into a .tar file, so now I have it both deployed on my local computer's Docker as well as in file form.

I know that when deploying a Che project using deploy_che.sh, I should append the --che-image=<myImage>:<myTag> command to it. This part is not problematic.

However, for security reasons I don't want to put my custom version of Che on a repository online. How can I move/copy it to OpenShift's Docker registry so when the project finally deploys, it'll look for the custom Che image locally and find it instead of looking for it online (Where it doesn't exist)?

Relevant information

As previously stated, this is Eclipse Che for OpenShift. The custom Che image is very similar to the default Che image, I just added some certificates to its truststore, which is precisely why I don't want to put it online in a repository, as that would be unsafe. Also, I have the custom image both running on my local Docker and also as a .tar file, so a solution with either will do just fine.

Thanks in advance :)

AmitChameides avatar Aug 26 '19 12:08 AmitChameides

@AmitChameides have you tried to push images directly to the OpenShift registry - https://docs.openshift.com/container-platform/3.3/install_config/registry/accessing_registry.html#access ?

ibuziuk avatar Aug 26 '19 13:08 ibuziuk

I have, but unfortunately there are two things which effectively stop me from doing this successfully:

  1. I don't know what is the IP address/port of the OpenShift registry (Is it the same as the ones used to access the OpenShift web UI?)
  2. My user doesn't have admin privileges (Though I can ask some other user to do this for me so this isn't a big problem).

AmitChameides avatar Aug 26 '19 13:08 AmitChameides

@AmitChameides Have you considered a private registry, e.g. on quay.io? There is a subscription associated, but short of deploying your own registry, I don't see many options. You could look into building in the cluster itself but I don't have much experience setting such a thing up.

amisevsk avatar Aug 26 '19 14:08 amisevsk

Both of these options have been considered, thank you. After some testing, I've faced these problems - Private Registry - Given the nature of private registries, only some people (By default, the Docker user who created them) can access them and interact with them. I'm unsure how to configure the Docker instance on OpenShift, and it does not have permissions to pull/import the image from the private repository. Building in the cluster - This is the option I've been trying for the time being, but unfortunately seeing as I don't know what is the connection details to my OpenShift instance's Docker registry, I'm struggling to build it straight it.

If anybody has any pointers or experience regarding this, I'd love hear it :)

AmitChameides avatar Aug 27 '19 07:08 AmitChameides

I'm unsure how to configure the Docker instance on OpenShift, and it does not have permissions to pull/import the image from the private repository.

Maybe it could help https://docs.openshift.com/enterprise/3.0/dev_guide/image_pull_secrets.html

sleshchenko avatar Aug 27 '19 07:08 sleshchenko

I'm unsure how to configure the Docker instance on OpenShift, and it does not have permissions to pull/import the image from the private repository.

Maybe it could help https://docs.openshift.com/enterprise/3.0/dev_guide/image_pull_secrets.html

Hey @sleshchenko , thanks for your help! Unfortunately, that's not exactly what I'm looking for. The image I'm trying to get isn't in another OpenShift project, but rather outside OpenShift altogether. It is also meant to replace one of the pods in the Che project, so calling its image from an existing pod won't work I think.

AmitChameides avatar Aug 27 '19 08:08 AmitChameides

@AmitChameides With a private quay repo (or private docker repo) you could set up a bot account that has pull permissions and then try to set up OpenShift to pull via that bot.

I think this is the canonical solution to deploying a non-public build of Che, but I haven't done it myself yet.

amisevsk avatar Aug 27 '19 14:08 amisevsk

Alright. Thank you all for your help. In the end, I wasn't able to properly set up a private repo which a bot was able to pull from and have OpenShift use that bot. I ended up putting my image on the public DockerHub registry simply because on second thought my image didn't contain any information that was secret.

I'm closing the issue because my particular issue has been fixed - putting my custom Che image on a public registry and then calling it when generating the project using the image-che= field worked as intended and made my Che project use my custom image. Still, if I did have truly secret information I wasn't able to put publicly, I'm not sure I would've been able to properly set it up in the methods you have described to get everything to work. I'm not very accustomed to all these technologies and still have much to learn.

AmitChameides avatar Aug 29 '19 07:08 AmitChameides