GithubHelp home page GithubHelp logo

gamussa / spring-boot-jib-workbench Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 63 KB

A workbench project how to use the Jib gradle plugin to create docker images for Spring Boot applications in Kotlin.

License: Apache License 2.0

Kotlin 100.00%

spring-boot-jib-workbench's Introduction

Spring Boot / Kotlin / Gradle / Jib Workbench

Build Status

…​ what it’s for

Demonstrate how to use the Jib Gradle Plugin to create a docker container.

Jib offers a new approach in generating Docker images for Java applications by by separating libraries, classes and resources into separate layers which speeds up deployment and reduces the size of the image layers that change often during application development. You can read more about Jib on the Jib GitHub Project page.

In addition the gradle script contains all necessary setup to use Kotlin and Spring Boot 2 for the implementation.

Note
Due to a problem in Version 0.9.8 of Jib it is not possible to use the openjdk base image. By default Jib uses gcr.io/distroless/java.

…​ how it’s setup

In order to be able to push the generated docker image to a registry you need to set the dockerRegistryPrefix property in the gradle.properties file. In case of the Docker Hub registry this is your username. By default the Jib plugin will use the authentication mechanism and credentials provided by the configuration of your docker configuration (for example ~/.docker/config.json)

The deployments folder contains a simple kubernetes deployment descriptor for this application. You have to update the image name in order to use your image.

…​ how it’s build

Build and push an image by issuing gradle jib.

To build the image and create a local Docker daemon use gradle jibDockerBuild.

…​ how it’s structured

The Gradle build script is split into multiple files that can be found in the gradle folder:

jib.gradle

Configures the Jib plugin.

kotlin.gradle

Is responsible for all things related to Kotlin.

test.gradle

Sets up Gradle to use JUnit 5 to run tests.

…​ what it can do

Since the purpose of the project is to demonstrate the build mechanism the application itself only provides two simple endpoints at /smoke and /burn.

In addition the Spring Actuator package is included in the application.

spring-boot-jib-workbench's People

Contributors

roamingthings avatar

Watchers

Viktor Gamov avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.