nginx-container icon indicating copy to clipboard operation
nginx-container copied to clipboard

Failed to deploy nginx 1.18 example on OCP 4.7

Open mJace opened this issue 4 years ago • 5 comments

Environment : Openshift 4.7.9 Log

oc new-app nginx:1.18~https://github.com/sclorg/nginx-container.git --context-dir=1.18/test/test-app/

error: the image match "nginx:1.18" for source repository "https://github.com/sclorg/nginx-container.git" does not appear to be a source-to-image builder.

- to attempt to use this image as a source builder, pass "--strategy=source"
- to use it as a base image for a Docker build, pass "--strategy=docker"

mJace avatar Jun 30 '21 02:06 mJace

@mJace Thanks for the issue. What command oc status --suggest shows? Do you want to use RHEL7 or RHEL8 image?

Can you please add to the oc command following for RHEL8:

oc new-app nginx:1.18-ubi8~https://github.com/sclorg/nginx-container.git --context-dir=1.18/test/test-app/

For RHEL7:

oc new-app nginx:1.18-ubi7~https://github.com/sclorg/nginx-container.git --context-dir=1.18/test/test-app/

The imagestream were slightly changed. We need to update all SCLORG container documentation.

phracek avatar Jun 30 '21 07:06 phracek

@phracek Hi, Thanks for the help. Here's the result of oc status --suggest with my original command

❯ oc new-project nginx-debug
Now using project "nginx-debug" on server "https://api.jaliang-ocp4.tamapac.support:6443".

You can add applications to this project with the 'new-app' command. For example, try:

    oc new-app rails-postgresql-example

to build a new example application in Ruby. Or use kubectl to deploy a simple Kubernetes application:

    kubectl create deployment hello-node --image=k8s.gcr.io/serve_hostname

❯
❯ oc new-app nginx:1.18~https://github.com/sclorg/nginx-container.git --context-dir=1.18/test/test-app/
error: the image match "nginx:1.18" for source repository "https://github.com/sclorg/nginx-container.git" does not appear to be a source-to-image builder.

- to attempt to use this image as a source builder, pass "--strategy=source"
- to use it as a base image for a Docker build, pass "--strategy=docker"
❯
❯
❯
❯ oc status --suggest
In project nginx-debug on server https://api.jaliang-ocp4.tamapac.support:6443

You have no services, deployment configs, or build configs.
Run 'oc new-app' to create an application.

Both RHEL 8 and 7 are OK, I just need to run an example for testing.

mJace avatar Jul 01 '21 03:07 mJace

Looks like the docs are still broken. The above example now works for ubi9 as well:

oc new-app nginx:1.20-ubi9~https://github.com/sclorg/nginx-container.git --context-dir=1.20/test/test-app/

nathanweeks avatar Jan 09 '23 21:01 nathanweeks

Hi @nathanweeks , would you be willing to file a PR that will fix documentation? Thanks

phracek avatar Jun 10 '24 10:06 phracek

Hi @nathanweeks , would you be willing to file a PR that will fix documentation? Thanks

@phracek: I can look into it, though it may be a little while before I can refresh my memory and test in a newer OpenShift environment.

nathanweeks avatar Jun 12 '24 21:06 nathanweeks