Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Template for Docker strategy build using code sourced from git repo #2

Closed
watkinspd opened this issue Mar 7, 2016 · 2 comments
Closed

Comments

@watkinspd
Copy link

There should be a instant-app type template that specifies a Docker build strategy and uses the Dockerfile and other application files from a git repo.

Scenario:

  • I have a github repo containing my app and a Dockerfile
    • to spin the app at pathfinder all I want to do is pick a "docker-git-repo" template from the catalog and paste the link to my git repo, specifiy the options for the route and such
    • the model should be like the one for the current nodejs template, but rather than depend on the redhat image for node, simpler to switch to a docker strategy and build from docker file
@f-w
Copy link

f-w commented Mar 7, 2016

Closest workaround for now is CLI oc new-app, but I can create such template.

@f-w
Copy link

f-w commented Mar 8, 2016

I have created the template and tested successfully to deploy bca-api. To use it, until the template has been promoted to root namespace, copy the yaml file to your local folder and run

oc create -f dockerfile-over-git.yaml

for updating existing template, run

oc replace -f dockerfile-over-git.yaml

instead.

There are several imperfections/caveats due to limited programbility within a template:

  1. Not only you have to specify git URL of Dockerfile, you also have to redundantly specify base image and tag which is in the FROM clause of Dockerfile.
  2. OpenShift cannot convert a parameter from string to number or vice versa (see Cannot specify integer/bool/base64 types in templates openshift/origin#3946) so not only I cannot obtain what port the docker is exposing the service by parsing the Dockerfile, but also I cannot even ask user to enter it as parameter. As a result, I have to hard code it to 8080. If this is incorrect for your Dockerfile, you have to change it in the runtime service instance after launch.

@f-w f-w closed this as completed Mar 8, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants