I have the following working dockerfile,
#using python3.6 image
FROM python:3.6
ENV PYTHONUNBUFFERED 1
#Installing required packages
RUN apt-get update
RUN apt-get install libsasl2-dev libldap2-dev libssl-dev python3-dev psmisc -y
#Installing a pip package which has django project in-built
RUN pip install <pip-package>
#Running a script-> appmanage.py, which installs a app to django project
RUN appmanage.py appconfig
#Running the django development server.
CMD ["manage.py","runserver","0.0.0.0:8000"]
How can i design a okd/openshift template yaml/json for this? I prefer a template in which the docker image-build will be handled in the template itself, instead of building a image with docker build and using the image name with tag in template.
To export BuldConfig as template:
Create BuildConfig with Dockerfile from a repo:
oc new-build --name python-app --strategy=docker https://somegitrepo/python-app
Or with inline Dockerfile:
cat Dockerfile | oc new-build --name python-app --dockerfile=-
Export the BuildConfig as template:
oc export bc python-app --as-template=python-app-template
Then you can create DeploymentConfig from the created imagestream and export dc/is too.