Features:
- OpenJDK 8
- Spring profiles
- Custom JAVA_OPTS
- Wrapper script that enables application to take PID 1 & receive SIGTERM signals
- Debug mode
Name | Default | Description |
---|---|---|
SPRING_PROFILES_ACTIVE | dev | Active Spring profiles |
JAVA_OPTS | JAVA_OPTS | |
DEBUG | false | Enable or disable debug mode |
DEBUG_PORT | 8000 | Debug port |
-
Simply extend your image from
arunramakani/spring-boot-docker
and set your application name as an environment variable:FROM arunramakani/spring-boot-docker ENV ARTIFACT_NAME my-spring-boot-application.jar
-
Copy your Spring Boot executable jar into an
assets
folder and build you image:docker build -t spring-boot-image .
-
Start your application:
- Using Docker CLI
docker run -d -p 8080:8080 -e JAVA_OPTS='-Xms256m -Xmx512m' SPRING_PROFILES_ACTIVE='test' spring-boot-image