Skip to content
S2I builder image for building and running maven based Spring Boot applications
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Spring Boot - CentOS Docker image

This repository contains the sources and Dockerfile of the base image for deploying Spring Boot applications as reproducible Docker images. The resulting images can be run either by Docker or using S2I.


To build a simple springboot-app application using standalone S2I and then run the resulting image with Docker execute:

$ s2i build atsistemas/springboot-polaris springboot-polaris-app
$ docker run -p 8080:8080 springboot-polaris-app

Accessing the application:

$ curl

Repository organization

  • s2i/bin/

    This folder contains scripts that are run by S2I:

    • assemble

      Is used to restore the build artifacts from the previous built (in case of 'incremental build'), to install the sources into location from where the application will be run and prepare the application for deployment (eg. using maven to build the application etc..)

    • run

      This script is responsible for running a Spring Boot fat jar using java -jar. The image exposes port 8080, so it expects application to listen on port 8080 for incoming request.

    • save-artifacts

      In order to do an incremental build (iow. re-use the build artifacts from an already built image in a new image), this script is responsible for archiving those. In this image, this script will archive the /opt/java/.m2 directory.

Environment variables

  • APP_ROOT (default: '.')

    This variable specifies a relative location to your application inside the application GIT repository. In case your application is located in a sub-folder, you can set this variable to a ./myapplication.

  • APP_TARGET (default: 'target')

    This variable specifies a relative location to your application binary inside the container.

  • MVN_ARGS (default: '')

    This variable specifies the arguments for Maven inside the container.

You can’t perform that action at this time.