Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DockerExecutor

Executes a Docker environment.

This class has a single method, execute, which starts a container from an image and runs the command specified in the Dockerfile CMD instruction.

It mounts the project's directory into the container a /work and uses it as the working directory.

It also sets the current user and group as the user and group in the container. This means that within the container the command that runs has the same permissions as the current user does in the /work directory.

Finally, it removes the container (but not the image).

This then is the equivalent of running the container with Docker from within the project directory using,

docker run --rm --volume $(pwd):/work --workdir=/work --user=$(id -u):$(id -g) <image>

Hierarchy

  • DockerExecutor

Index

Methods

Methods

execute

  • execute(name: string, folder: string, command?: string): Promise<any>
  • Run a Docker container

    Parameters

    • name: string

      Name of the Docker image to use

    • folder: string

      Path of the project folder which will be mounted into the image

    • Default value command: string = ""

    Returns Promise<any>

Generated using TypeDoc