Skip to content

Publish jib-cli so it can be used from Java code #4391

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lion7
Copy link

@lion7 lion7 commented Jun 16, 2025

I'm trying to use jib to publish my frontend image as well, just as I did for my Java backend. Previously I used the Docker CLI for this, but I'd like to create all my images without the use of a daemon or elevated rights. If the jib CLI itself would also be published to Maven central, I can re-use it from my Gradle build script to build a non-java image like so:

plugins {
  id("org.siouan.frontend-jdk21") version "10.0.0"
}

frontend {
  nodeVersion.set("24.2.0")
  assembleScript.set("run build")
  checkScript.set("run lint")
}

task<JavaExec>("jib") {
  group = "jib"
  description = "Builds and pushes the container image to the container registry."
  mainClass.set("com.google.cloud.tools.jib.cli.JibCli")
  dependsOn("assembleFrontend")
  args("build", "--image-metadata-out=build/jib-image.json", "--target", "my-image:latest")
}

For completeness and for people coming here from Google, this is my accompanying jib.yaml:

apiVersion: jib/v1alpha1
kind: BuildFile
from:
  image: caddy
layers:
  entries:
    - name: "static"
      files:
        - src: "Caddyfile"
          dest: "/etc/caddy/Caddyfile"
        - src: "dist/"
          dest: "/srv"

I'm trying to use `jib` to publish my frontend image as well, just as I did for my Java backend.
Copy link

google-cla bot commented Jun 16, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant