[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Modifying an example image for deployment from source





On Wed, Jul 20, 2016 at 7:53 PM, Tony Saxon <tony saxon gmail com> wrote:
I'm trying to take an existing Django application that we have running on a system and make it so that I can deploy into a lab origin environment that I have set up. I started by going through the example Django application: https://github.com/openshift/django-ex

I didn't have any major problems with deploying that. I then tried to adapt our existing application based on the example; I added the requirements text file made some small label modifications to the template file and attempted to deploy our application from our private git repository. It is bombing out while building the application due to the fact that it is unable to install one of the items listed in the requirements.txt file. I built another docker container and narrowed it down to needing the libffi-devel package.

​i'm not familiar with the package, but if you think it's a common package people will need, consider opening an issue against the python repo requesting it be added to the python s2i builder image:
https://github.com/sclorg/s2i-python-container
 

After pouring over the documentation, I'm having trouble figuring out the proper way to make a source image based on the openshift/django:3.5 image that has the included package. I've gone over the documentation for building s2i images and such, but don't quite grasp the procedure for building something generic that does not have any application source code included and pushing that to an internal repository to be included in a configuration file and be deployed with the new-app command. Any help would be greatly appreciated, thanks.

Not sure what "openshift/django:3.5" is, but assuming you mean the python image, what you need to do is write a Dockerfile like:

FROM centos/python-35-centos7
USER root
RUN yum install -y libffi-devel​
USER 1001  # must set user back to a non-root user

then docker build that dockerfile (you can't build it on openshift online since we don't allow Docker builds, but if you have your own cluster, you can set up a docker type build to build+push that image to your openshift registry).

Assuming you built it locally, then you'll want to push it to your openshift cluster registry (or dockerhub or some other registry) and then you can reference it from an s2i build.

If you need instructions for how to "docker login" to the openshift registry:
https://docs.openshift.org/latest/install_config/install/docker_registry.html#access-logging-in-to-the-registry



 

_______________________________________________
users mailing list
users lists openshift redhat com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users




--
Ben Parees | OpenShift


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]