{"id":16540543,"url":"https://github.com/itzg/simple-boot-image-gradle-plugin","last_synced_at":"2025-10-28T14:31:32.631Z","repository":{"id":37028526,"uuid":"493048426","full_name":"itzg/simple-boot-image-gradle-plugin","owner":"itzg","description":"A simple Gradle plugin to build very simple Spring Boot application Docker images","archived":false,"fork":false,"pushed_at":"2025-01-27T14:51:16.000Z","size":214,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-01T15:23:26.698Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itzg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2022-05-17T01:03:48.000Z","updated_at":"2025-01-27T14:51:18.000Z","dependencies_parsed_at":"2024-01-14T03:29:46.584Z","dependency_job_id":"2d809aa8-2a64-4555-85ff-0ec3cd44b05e","html_url":"https://github.com/itzg/simple-boot-image-gradle-plugin","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzg%2Fsimple-boot-image-gradle-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzg%2Fsimple-boot-image-gradle-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzg%2Fsimple-boot-image-gradle-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzg%2Fsimple-boot-image-gradle-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itzg","download_url":"https://codeload.github.com/itzg/simple-boot-image-gradle-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238663117,"owners_count":19509733,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-10-11T18:52:43.593Z","updated_at":"2025-10-28T14:31:32.308Z","avatar_url":"https://github.com/itzg.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Gradle Plugin Portal](https://img.shields.io/gradle-plugin-portal/v/io.github.itzg.simple-boot-image)](https://plugins.gradle.org/plugin/io.github.itzg.simple-boot-image)\n\nA simple Gradle plugin to build very simple Spring Boot application Docker images.\n\n\u003e Just Docker, Java, and your Spring Boot application\n\nMore specifically, this plugin automates the best practices described in the [Spring Boot Container Images](https://docs.spring.io/spring-boot/reference/packaging/container-images/dockerfiles.html) documentation by\n- Hooking into the `bootJar` task of the [Spring Boot Gradle Plugin](https://docs.spring.io/spring-boot/docs/current/reference/html/build-tool-plugins.html#build-tool-plugins.gradle)\n- Extracting the application layers\n- Generating a Dockerfile\n- Performing the docker build\n- Pushing to a registry\n\nSome additional features include\n- Optional support for non-layered images that just `java -jar application.jar`\n- Easy to integrate with [Skaffold](https://skaffold.dev/) a [custom build stage](https://skaffold.dev/docs/pipeline-stages/builders/custom/)\n\n## Requirements\n\nThe Docker client needs to be installed locally with access to a Docker daemon. If pushing the image, `docker login` needs to be performed for the desired image registry.\n\n## Primary tasks\n\n- `buildSimpleBootImage`\n  - **NOTE** if using buildx, the default, pushing to a registry can be optimized into this same task by setting the extension property `simpleBootImage.push` to `true`.\n- `pushSimpleBootImage`\n\n## Configuration\n\nThis plugin adds an extension named `springBootImage`; however, the defaults use a combination of gradle properties and environment variables to adapt easily to CI/CD and Skaffold builds.\n\nThe properties of the extension are:\n\n| Name                    | Description                        | Default                                                                                     |\n|-------------------------|------------------------------------|---------------------------------------------------------------------------------------------|\n| baseImage               |                                    | Property `imageBase`\u003cbr/\u003eor `\"eclipse-temurin:17\"`                                          |\n| cacheFrom               |                                    | Property `imageCacheFrom`                                                                   |\n| cacheTo                 |                                    | Property `imageCacheTo`                                                                     |\n| exportPort              |                                    | `8080`                                                                                      |\n| fullyQualifiedImageName |                                    | Environment variable `IMAGE`\u003cbr/\u003eor uses `imageRepo`, `imageName`, and `tags`               |\n| imageName               | Name part of `{repo}/{name}:{tag}` | Property `imageName`\u003cbr/\u003eor `project.name`                                                  |\n| imageRepo               | Repo part of `{repo}/{name}:{tag}` | Property `imageRepo`                                                                        |\n| layered                 |                                    | Property `imageLayered`\u003cbr/\u003eor `true`                                                       |\n| platforms               | `os/arch` list supported by buildx | _Default for builder_                                                                       |\n| pullForBuild            |                                    | Property `imagePull`\u003cbr/\u003eor `false`                                                         |\n| push                    |                                    | Property `imagePush`\u003cbr/\u003eor Environment variable `PUSH_IMAGE`\u003cbr/\u003eor `false`                |\n| tags                    | Tag part of `{repo}/{name}:{tag}`  | `[\"latest\", project.version]`                                                               |\n| useBuildx               |                                    | `true`                                                                                      |\n| labels.description      |                                    | `project.description`                                                                       |\n| labels.extra            | Map of extra labels to apply       | `[:]`                                                                                       |\n| labels.revision         |                                    | Property `git.commit`                                                                       |\n| labels.sourceUrl        |                                    | If environment variable `GITHUB_REPOSITORY`, then `https://github.com/${GITHUB_REPOSITORY}` |\n| labels.title            |                                    | `project.name`                                                                              |\n| labels.version          |                                    | Property `imageVersion`\u003cbr/\u003eor `project.version`                                            |\n\n## Examples\n\n### Skaffold configuration\n\nskaffold.yaml:\n```yaml\n# nonk8s\napiVersion: skaffold/v3\nkind: Config\nmetadata:\n  name: app-dev\nbuild:\n  artifacts:\n    - image: app-dev\n      custom:\n        buildCommand: ./gradlew pushSimpleBootImage\n        dependencies:\n          paths:\n            - build.gradle\n            - src/main/java\n            - src/main/resources\nprofiles:\n  - name: windows\n    build:\n      artifacts:\n        - image: app-dev\n          custom:\n            # override this since Windows needs backslash'y paths\n            buildCommand: .\\gradlew pushSimpleBootImage\nmanifests:\n  rawYaml:\n    - k8s/*.yml\n```\n\nIn `build.gradle`, you should also add the following to [hook into the test flag](https://skaffold.dev/docs/pipeline-stages/builders/custom/).\n\n```groovy\ntest.onlyIf { !System.getenv('SKIP_TESTS') }\n```\n\n### GitHub Actions Workflow\n\nSingle platform:\n```yaml\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v2\n\n      - name: Login to image registry\n        uses: docker/login-action@v2\n        with:\n          registry: ghcr.io\n          username: ${{ github.actor }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: Gradle build and push\n        uses: gradle/gradle-build-action@v2\n        with:\n          arguments: |\n            -PimageRepo=ghcr.io/${{ github.actor }}\n            -PimagePush=true \n            -PimageCacheFrom=type=gha\n            -PimageCacheTo=type=gha,mode=max\n            buildSimpleBootImage\n```\n\nand multi-platform using buildx:\n```yaml\n    steps:\n      - name: Setup Docker Buildx\n        uses: docker/setup-buildx-action@v2\n\n      - name: Set up QEMU\n        uses: docker/setup-qemu-action@v2.0.0\n\n      - name: Login to image registry\n        uses: docker/login-action@v2\n        with:\n          registry: ghcr.io\n          username: ${{ github.actor }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: Gradle build and push\n        uses: gradle/gradle-build-action@v2\n        with:\n          arguments: |\n            -PimageRepo=ghcr.io/${{ github.actor }}\n            -PimagePlatforms=linux/amd64,linux/arm64\n            -PimagePush=true \n            -PimageCacheFrom=type=gha\n            -PimageCacheTo=type=gha,mode=max\n            buildSimpleBootImage\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitzg%2Fsimple-boot-image-gradle-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitzg%2Fsimple-boot-image-gradle-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitzg%2Fsimple-boot-image-gradle-plugin/lists"}