Forge
Plugins

JIB

Plugin for building container images with JIB

@bjb-forge/nx-jib-project

Installation

npx forge add @bjb-forge/nx-jib-project

Configuration

JIB reads configuration from forge- prefixed labels in your jib.yaml file.

apiVersion: jib/v1alpha1
kind: BuildFile

from:
  image: ubuntu

labels:
  forge-registry: docker.io/myuser
  forge-claim: my-claim
  forge-username: ${env.REGISTRY_USERNAME}
  forge-password: ${env.REGISTRY_PASSWORD}

Labels

LabelDescription
forge-registryThe registry the OCI image will be pushed to. Defaults to docker.io.
forge-claimOptional registry path (claim) used when pushing the image.
forge-usernameUsername for authentication with both target and base image registries.
forge-passwordPassword for authentication with both target and base image registries.
forge-fromUsernameUsername for authentication with the base image registry.
forge-fromPasswordPassword for authentication with the base image registry.
forge-toUsernameUsername for authentication with the target image registry.
forge-toPasswordPassword for authentication with the target image registry.
forge-parametersComma-separated key=value pairs to substitute in jib.yaml. The parameter projectRoot is always available.

The built-in parameters projectRoot and version are injected automatically and do not need to be declared.

Inferred Targets

nx-release-publish

Builds and publishes a container image using JIB (Java Image Builder).

Condition: All projects containing a jib.yaml

Generators

jib-project

jib-project generator

nx g @bjb-forge/nx-jib-project:jib-project [options]

| Option | Type | Required | Default | Description | | ----------- | -------- | -------- | ------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------ | | directory | string | Yes | - | A directory where the jib config is placed. | | registry | string | null | No | null | The registry the OCI image will be pushed to. For example: 'docker.io/myuser. Defaults to 'docker.io'. |

On this page