Also, note that "translating an image to an app" is what new-app does.

You can run "oc new-app GIT_REPO -o yaml --dry-run" to see what new-app
generates, and pipe that directly into the export command:

    oc new-app ... | oc export -f - --as-template=foo > template.yaml

Which generates the final template to a file on disk.

On Jan 19, 2016, at 4:06 AM, Rodolfo Carvalho <[email protected]> wrote:

Hi Den,

You don't need to "translate" the Dockerfile to a template. Instead, you
can create a Docker build that will build an image out of the Dockerfile
and can be deployed in OpenShift.

https://docs.openshift.org/latest/dev_guide/builds.html#defining-a-buildconfig
https://docs.openshift.org/latest/dev_guide/builds.html#docker-strategy-options


You can also create a template that will automated the creation of a
BuildConfig, a DeploymentConfig, a Service, etc, see this example:
https://github.com/openshift/origin/blob/master/examples/sample-app/application-template-dockerbuild.json


In the example, the BuildConfig.spec.source refers to a git repository that
contains a Dockerfile. You can also use an inline Dockerfile as a source of
your BuildConfig:
https://docs.openshift.org/latest/dev_guide/builds.html#dockerfile-source


-- 
Rodolfo Carvalho

OpenShift Developer Experience


On Tue, Jan 19, 2016 at 8:43 AM, Den Cowboy <[email protected]> wrote:

> Hi, I have some Docker images and a Dockerfile.
> Now they want to deploy their containers in OpenShift.
> Is it possible to translate a whole dockerfile to an OpenShift-template?
>
> _______________________________________________
> users mailing list
> [email protected]
> http://lists.openshift.redhat.com/openshiftmm/listinfo/users
>
>


_______________________________________________
users mailing list
[email protected]
http://lists.openshift.redhat.com/openshiftmm/listinfo/users
_______________________________________________
users mailing list
[email protected]
http://lists.openshift.redhat.com/openshiftmm/listinfo/users

Reply via email to