JSPM

@rxap/plugin-docker

20.0.5-dev.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 590
  • Score
    100M100P100Q85148F
  • License GPL-3.0-or-later

This plugin provides executors and generators for building and saving Docker images within an Nx workspace. It simplifies the process of creating Dockerfiles, building images, and pushing them to registries, as well as saving images to archives. It also includes generators for configuring projects and generating GitLab CI pipelines for Docker-based applications.

Package Exports

  • @rxap/plugin-docker
  • @rxap/plugin-docker/package.json
  • @rxap/plugin-docker/plugin

Readme

This plugin provides executors and generators for building and saving Docker images within an Nx workspace. It simplifies the process of creating Dockerfiles, building images, and pushing them to registries, as well as saving images to archives. It also includes generators for configuring projects and generating GitLab CI pipelines for Docker-based applications.

npm version commitizen friendly styled with prettier Libraries.io dependency status for latest release, scoped npm package npm NPM

Installation

Add the package to your workspace:

yarn add @rxap/plugin-docker

Execute the init generator:

yarn nx g @rxap/plugin-docker:init

Execute the config generator to use the package with a project:

yarn nx g @rxap/plugin-docker:config [project]

Generators

config

Add the executor 'docker' to the selected project and add generic depend on rules to nx.json

nx g @rxap/plugin-docker:config
Option Type Default Description
project string The name of the project.
context string Path to context for the docker build process.
dockerfile string Path to the dockerfile.
buildTarget string The target from witch the output path can be extract.
imageSuffix string A suffix added to the base image name
imageName string The base image name
imageRegistry string The image registry
command string The command to start docker
save boolean Whether to create a save target
overwrite boolean Whether to overwrite existing files

gitlab-ci

gitlab-ci generator

nx g @rxap/plugin-docker:gitlab-ci
Option Type Default Description
gcp boolean Generate docker startup test with pull target to GCP registry
gitlab boolean Generate docker startup test with pull target to gitlab registry
overwrite boolean Overwrite existing files
skipFormat boolean false
tags array

init

Initialize the package in the workspace

nx g @rxap/plugin-docker:init
Option Type Default Description
skipFormat boolean false

Executors

build

Executes the docker build command with the context set to the build output folder

Option Type Default Description
context string The docker build context path
dockerfile string The path to the dockerfile
tag array A list of docker image tags
buildTarget string The target from witch the output path can be extract.
imageSuffix string A suffix added to the base image name
imageName string The base image name
imageRegistry string The image registry
command string docker The command to start docker
latest boolean false If true a destination with a latest tag is added
push boolean false If true all created images are pushed
buildArgList array

save

Executes the docker save command for the latest image created with the build command

Option Type Default Description
outputPath string output path for the tar.gz files
imageSuffix string A suffix added to the base image name
imageName string The base image name