Skip to content

cshulman/vertx-docker-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Containerized a basic "Hello World" Vertx project with a unit test (https://github.com/bassdude5/Vertx_HelloWorld)

Steps for deploying to Openshift

  1. Login to OpenShift:
    oc login
  2. Login to Docker:
    docker login -u username -p $(oc whoami -t) docker.registry.url
  3. Create a new OpenShift project:
    oc new-project vertx
  4. Build the app to get the jar (note the jar name needs to be the same as the jar name specified in the Dockerfile):
    mvn clean install
  5. Build the image (here we are specifying the openshift namespace so the image can be accessed across all namespaces):
    docker build -t openshift/java-fat-jar-example:latest .
  6. View the image:
    docker images
  7. Tag the image with docker.registry/image-name:version
    docker tag openshift/java-fat-jar-example docker.registry.url/openshift/java-fat-jar-example:latest
  8. Push the image to the internal registry:
    docker push docker.registry.url/openshift/java-fat-jar-example:latest
  9. Create the application (make sure you're in the correct namespace):
    oc new-app --docker-image=docker.registry.url/openshift/java-fat-jar-example:latest
  10. Verify that your pods are up:
    oc get pods
  11. Edit the service to route through port 8081 (as this app requires). Change the port, target port and the port name:
    oc edit svc servicename
  12. Confirm that the service is correct:
    oc describe svc servicename
  13. Expose the service:
    oc expose svc servicename
  14. get the route:
    oc get route
  15. Access the route via comand line or open in your browser:
    curl route

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published