- Create project
> oc new-project source-to-image- Create a new app, based on s2i strategy
> oc new-app --name source-to-image -i openjdk18-openshift https://github.com/rofrba/examples-openshift --context-dir hello-world-java- Expose the service
> oc expose svc source-to-imageOPTIONAL: If you need to use a Secret to pull source code from the git repository, you can create a secret and add it to the buildConfig
oc create secret generic git-credentials --from-literal=username=myUserName --from-literal=password=myPassword> oc new-app --name source-to-image -i java:8 https://github.com/rofrba/examples-openshift --context-dir hello-world-java --source-secret=git-credentialsNOTA: Si no contamos con la imagen base openjdk18-openshift, debemos ejecutar el comando:
> oc import-image redhat-openjdk-18/openjdk18-openshift --from=registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift --confirm