Skip to content

Latest commit

 

History

History
28 lines (16 loc) · 1.29 KB

README.md

File metadata and controls

28 lines (16 loc) · 1.29 KB

Dockeriser

Spring boot demo project to integrate with Docker and run on Kubernetes

How to build

Run build.sh script: this will generate the jar and Docker image ready to be run.

How to run

Execute docker run -P <image-tag> (to bind container port to a random host port) or docker run -p8080:8080 <image-tag> (to bind it to a specific local port)

Note: <image-tag> is the GCR url that is printed at the end the execution of build.sh.

Consuming Secrets and Config Maps variables

The values injected into the containers are available using environent variables. The application consumes them in two ways:

  • Directly from the envs using System.getEnv()
  • Using Spring properties.

The first option is straightforward. You can see this on DockeriserApplication.kt

You can see the second option in these files: