Plugins
Docker
Plugin for Docker container projects
@bjb-forge/nx-docker-project
Installation
npx forge add @bjb-forge/nx-docker-projectPlugin Options
{
"plugin": "@bjb-forge/nx-docker-project/nx-plugin",
"options": {}
}| Option | Type | Description |
|---|---|---|
build.targetName | string | The name of the build target |
run.targetName | string | The name of the run target |
Configuration
Docker projects use a standard Dockerfile in the project root. The plugin reads the following label to configure release publishing:
FROM ubuntu:noble AS builder
LABEL repositoryName="my-claim/my-image"
WORKDIR /appLabels
| Label | Description |
|---|---|
repositoryName | The image repository path used when publishing the container image. |
Inferred Targets
build
Builds a Docker image using docker build.
Condition: All projects containing a Dockerfile
run
Runs a Docker container from the built image.
Condition: All projects containing a Dockerfile
Generators
docker-project
Create a Docker project
nx g @bjb-forge/nx-docker-project:docker-project [options]| Option | Type | Required | Default | Description |
|---|---|---|---|---|
directory | string | Yes | - | A directory where the project is placed. |
baseImage | string | No | ubuntu:noble | Base Docker image to use |