Forge
Plugins

Docker

Plugin for Docker container projects

@bjb-forge/nx-docker-project

Installation

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

Plugin Options

{
  "plugin": "@bjb-forge/nx-docker-project/nx-plugin",
  "options": {}
}
OptionTypeDescription
build.targetNamestringThe name of the build target
run.targetNamestringThe 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 /app

Labels

LabelDescription
repositoryNameThe 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]
OptionTypeRequiredDefaultDescription
directorystringYes-A directory where the project is placed.
baseImagestringNoubuntu:nobleBase Docker image to use

On this page