{"id":20093816,"url":"https://github.com/trion-development/openshift-spring-boot-s2i","last_synced_at":"2026-05-15T05:07:08.386Z","repository":{"id":80554019,"uuid":"146497808","full_name":"trion-development/openshift-spring-boot-s2i","owner":"trion-development","description":null,"archived":false,"fork":false,"pushed_at":"2019-07-02T11:06:43.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-02T16:15:57.471Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trion-development.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-28T19:37:29.000Z","updated_at":"2019-07-02T11:06:45.000Z","dependencies_parsed_at":"2023-03-13T20:09:32.528Z","dependency_job_id":null,"html_url":"https://github.com/trion-development/openshift-spring-boot-s2i","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/trion-development/openshift-spring-boot-s2i","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trion-development%2Fopenshift-spring-boot-s2i","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trion-development%2Fopenshift-spring-boot-s2i/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trion-development%2Fopenshift-spring-boot-s2i/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trion-development%2Fopenshift-spring-boot-s2i/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trion-development","download_url":"https://codeload.github.com/trion-development/openshift-spring-boot-s2i/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trion-development%2Fopenshift-spring-boot-s2i/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33054467,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-15T02:00:06.351Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T16:48:30.279Z","updated_at":"2026-05-15T05:07:08.371Z","avatar_url":"https://github.com/trion-development.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenShift Spring Boot S2I\n\n## Builder Image\nThe following tables describes the files used in this image.\n\n| File                   | Required? | Description                                                  |\n|------------------------|-----------|--------------------------------------------------------------|\n| Dockerfile             | Yes       | Defines the base builder image                               |\n| s2i/bin/assemble       | Yes       | Script that builds the application                           |\n| s2i/bin/usage          | No        | Script that prints the usage of the builder                  |\n| s2i/bin/run            | Yes       | Script that runs the application                             |\n| s2i/bin/save-artifacts | No        | Script for incremental builds that saves the built artifacts |\n| test/run               | No        | Test script for the builder image                            |\n| test/test-app          | No        | Test application source code                                 |\n\n### Dockerfile\nBuilds the builder image itself, installing Maven and Gradle and using OpenJDK as base image.\n\n\n### S2I scripts\nCalled by OpenShift for the lifecycle of the application.\n\n\n#### assemble\n- Copies the Spring Boot Application source from `/tmp/src` to `/opt/app-root/src`\n- Determines the build type from the BUILD_TYPE environment variable\n- Executes a build of the application using the determined build typen, if a `pom.xml` is detected\n- The build artifact is copied to `/opt/openshift` and a new image with the Spring Boot Application for OpenShift is created\n- To support deployment of already built Spring Boot JAR applications in OpenShift a runtime image is created when no `pom.xml` is detected. The JAR must be present in the `/tmp/src` directory.\n\nTo reduce build time, any saved artifacts from the previous image build are restored.\n\n#### run\nThe *run* script is used to start/run the Spring Boot application in OpenShift.\n\n#### save-artifacts (optional)\nThe *save-artifacts* script allows a new build to reuse content (dependencies) from a previous version of the application image.\n\n\n### Create the Spring Boot Application S2I builder image\nThe following command will create a S2I builder image named **spring-boot** based on the Dockerfile.\nUse the OpenShift Docker, f.e. `eval $(minishift docker-env)`\n\n```\ndocker build -t spring-boot .\n```\n\n### Creating the *Application Container Image*\nThe application container image contains the built application binary which is layered on top of the builder (base) image.  The following command will create the application container image:\n\n**Usage:**\n```\ns2i build \u003clocation of source code\u003e \u003cS2I builder image name\u003e \u003capplication container image name\u003e\n```\n\n```\ns2i build test/test-app spring-boot boot-app\n---\u003e Building and installing application from source...\n```\nBased on the logic defined in the *assemble* script, s2i will create an application container image using the supplied S2I builder image and the application source code from the *test/test-app* directory.\n\n### Running the application container image\nRunning the application image is as simple as invoking the docker run command:\n```\ndocker run -d -p 8080:8080 boot-app\n```\nThe application *boot-app*, should now be accessible at  [http://localhost:8080](http://localhost:8080).\n\n### Using the saved artifacts script\nRebuilding the application using the saved artifacts can be accomplished using the following command:\n```\ns2i build --incremental=true test/test-app spring-boot boot-app\n---\u003e Restoring build artifacts...\n---\u003e Building and installing application from source...\n```\nThis will run the *save-artifacts* script which includes the code to backup the currently running application dependencies. When the application container image is built next time, the saved application dependencies will be re-used to build the application.\n\n## Using the OpenShift Spring Boot Application S2I builder image\n\nCreate the S2I builder image and push it to the integrated docker registry for the current project:\n\n```\noc new-build --strategy=docker --name=spring-boot https://github.com/trion-development/openshift-spring-boot-s2i.git\n```\n\nIt can now be used for a build\n\n```\noc new-build spring-boot~https://github.com/trion-development/spring-boot-rest-sample.git\n```\n\nTo be able to use it for creating deployment through the UI upload the template to the current project:\n\n```\ncurl -Ssl https://raw.githubusercontent.com/trion-development/openshift-spring-boot-s2i/master/spring-boot-s2i.json | oc create -f -\n```\n\nOpen the OpenShift web console (Browser UI) and open the current project.\nClick \"Add to Project\" in the upper right, choose \"Select from project\" and use the \"spring-boot\" template.\nSpecify the application details.\n\nAfter clicking 'create' the following steps will be performed:\n\n- Application build\n- Creation of application container image\n- Image push to OpenShift Docker Registry\n- Creation of a deployment of the applicatoin as a pod\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrion-development%2Fopenshift-spring-boot-s2i","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrion-development%2Fopenshift-spring-boot-s2i","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrion-development%2Fopenshift-spring-boot-s2i/lists"}