0

I'm trying to run a containerized app which is stored in Nexus docker hosted on url 12.23.34.55:8086 I'm trying to run it on my Openshift Cluster, but I'm getting error. Commands I'm using to run

oc create secret docker-registry mysecret --docker-server=http://12.23.34.55/ --docker-username=aditya --docker-password=aditya --docker-email=aditya@example.org


oc secrets link default mysecret  --for=pull

My nexus is running on http://12.23.34.55:8081

Now I'm using command to launch in OpenShift using below command.

oc new-app 12.23.34.55:8085/mytestapp:11 --insecure-registry=true

as per $ oc new-app myregistry:5000/example/myimage https://docs.openshift.com/container-platform/4.1/applications/application_life_cycle_management/creating-new-applications.html

But it does not work, it asks for password and not able to deploy from console too, can anyone help me with exact commmand.

Aditya Malviya
  • 1,907
  • 1
  • 20
  • 25

2 Answers2

0

Creating the secret is not enough for OpenShift to be able to pull from the registry. You still need to link that secret as well.

Take a look at the official documentation here: https://docs.openshift.com/container-platform/4.1/openshift_images/managing_images/using-image-pull-secrets.html#images-allow-pods-to-reference-images-from-secure-registries_using-image-pull-secrets

meaningqo
  • 1,653
  • 10
  • 16
0

Okay! I found an answer, so using private registry first we should import image using

oc import name url/imagename:tag

then we can create new app with the same

oc new app name 
Aditya Malviya
  • 1,907
  • 1
  • 20
  • 25