lvthillo
lvthillo

Reputation: 30723

OpenShift V3: understanding the process with Docker

I'm trying to understand OpenShift V3. I read a lot about it and I know the most important terms but the whole flow remains a bit unclear. So I've installed OpenShift V3 in a Docker container. Than it's time to start the proces:

1) First they're doing a docker registry. Why and do you have to do it every time?

Than I create a project and an application in it. In the most tutorials I saw they're doing it like this:

mkdir -p examples/app
$ wget \
https://raw.githubusercontent.com/openshift/.../template-stibuild.json \
$ oc new-app application-template-stibuild.json

2) So this is when you're using a template to create your app, you must do a 'wget' everytime? In a lot of tutorials they start immediately with:

oc create -f \
    /usr/share/openshift/.../name.json \
    -n openshift

3) What's the difference betweet oc new-app and oc create -f ...

4) Why do you have to pull images from the Docker Hub? What is it doing? I'm mostly getting a .json file from github to start (templates). This json is pulling the images than.

5) What is an image-stream?

6) What is an image registry?

Upvotes: 1

Views: 541

Answers (1)

Clayton
Clayton

Reputation: 3316

When you run OpenShift inside a container, it is self contained, so if you remove the container the metadata describing the registry is lost. You only need to install a registry once for a given cluster.

The wget argument for templates for new-app is because new-app takes source code URLs as arguments, and so we can't tell the difference between a Git repository and a template.

Create is a command for creating individual objects, while new-app takes input like source and Docker images and figures out what API objects you need, then creates them.

You don't have to pull images from the Hub or a private Docker registry. OpenShift has image streams, which are like virtual Docker repositories that you can easily move images between. The image stream tags are like branches in git, and they can point to images in the integrated registry or off OpenShift. new-app uses the description of the image (what ports it uses, what labels it has) from the Docker Hub to generate the rest of the app.

When you push a docker image, the place you push to is called an image repository (foo/bar), which is on an image registry (the Docker Hub or a private registry).

Upvotes: 2

Related Questions