Sign inSign up

sarcouy/s2i-springboot

By sarcouy

•Updated over 9 years ago

Openshift Source To Image to build and deploy SpringBoot apps

Image
1

1.1K

sarcouy/s2i-springboot repository overview

⁠SpringBoot - CentOS Docker image

All of that is sampled from Wildfly openshift s2i project⁠

This repository contains the source for building various versions of pringboot applications as a reproducible Docker image using source-to-image⁠. The resulting image can be run using Docker⁠.

⁠Installation

This image is available on DockerHub. To download it, run:

$ docker pull sarcouy/s2i-springboot:jdk$JDK_VERSION-mvn$MAVEN_VERSION

for example

$ docker pull sarcouy/s2i-springboot:jdk8-mvn3.3.9 

⁠Usage

To build a simple java application using standalone S2I⁠ and then run the resulting image with Docker⁠ execute:

$ s2i build -e JAR_NAME=app.jar -e INCREMENTAL=false git://github.com/example/openshift-springboot-example sarcouy/s2i-springboot:jdk8-mvn3.3.9 springboottest
$ docker run -p 8080:8080 springboottest

If you want to use an incremental build, INCREMENTAL=true is the defaul value, so you can skip it (even if I don't skip it for the example)

$ s2i build -e JAR_NAME=app.jar -e INCREMENTAL=true --incremental git://github.com/example/openshift-springboot-example sarcouy/s2i-springboot:jdk8-mvn3.3.9 springboottest
$ docker run -p 8080:8080 springboottest

Accessing the application:

$ curl 127.0.0.1:8080

⁠Environment variables

To set environment variables, you can place them as a key value pair into a .sti/environment file inside your source code repository or add -e FOO=BAR to s2i build -e FOO=BAR .

  • MAVEN_ARGS

    Overrides the default arguments passed to maven durin the build process

  • MAVEN_ARGS_APPEND

    This value will be appended to either the default maven arguments, or the value of MAVEN_ARGS if MAVEN_ARGS is set.

  • INCREMENTAL

    This is a boolean : Set as "true" it avoid removing .m2 in between two builds (but that makes heavier images). Must be used with s2i build --incremental, If you don't want an incremental build, and a lighter docker image set -e INCREMENTAL=false Default to true

  • JAR_NAME

    Name of the jar file to run after maven build JAR_NAME=myApp.jar

  • POM_PATH

    Usefull for many pom.xml git repositories, specify the path to follow into the repo to find the pom file to use. default to POM_PATH=.

Released under the Apache License 2.0. See the LICENSE⁠ file.

Tag summary

Content type

Image

Digest

Size

214.2 MB

Last updated

over 9 years ago

docker pull sarcouy/s2i-springboot:jdk6-mvn3.2.5