Gradle Jib build

CustomDockerImage build with Gradle and Jib plugin

DockerImage component uses Kaniko to build the Docker images from a Dockerfile. For cases with other image building solutions you can use CustomDockerImage and run whatever commands you need.

Here is an example with CustomDockerImage component building an image from a Java app with Gradle and Jib plugin.

Gradle with Jib plugin

You can check the Gradle and Jib configuration in the repository All you need to do in the CustomDockerImage component is to pass the image name and push credentials to the Gradle command. See Custom Docker Image for $BNS_IMAGE_* environment variables.

kind: Environment
name: 'SpringBoot Gradle'
type: primary
        kind: CustomDockerImage
        name: api-image
        gitRepo: ''
        gitBranch: main
        gitApplicationPath: components/springboot-rest-api-gradle
        runnerImage: 'openjdk:17-jdk-alpine'
            - 'cd ./components/springboot-rest-api-gradle'
        kind: Application
        name: api
        gitRepo: ''
        gitBranch: main
        gitApplicationPath: components/springboot-rest-api-gradle
            image: '{{ components.api-image.image }}'
                DATABASE_DBNAME: bunny_books
                DATABASE_HOST: db
                DATABASE_PASSWORD: need-to-replace
                DATABASE_PORT: '3306'
                DATABASE_USER: books
                FRONTEND_URL: 'https://{{ components.frontend.ingress.hosts[0].hostname }}'
                - '9000:9000'
                hostname: 'api-{{ env.base_domain }}'
                path: /
                servicePort: 9000
            - api-image

Then you use the built image in another component, like an Application in the example, using the interpolation expression.