Skip to content

ILocalBundling

Local bundling.

Methods

Name Description
try_bundle This method is called before attempting docker bundling to allow the bundler to be executed locally.

try_bundle

def try_bundle(
  output_dir: str,
  image: DockerImage,
  bundling_file_access: BundlingFileAccess = None,
  command: typing.List[str] = None,
  entrypoint: typing.List[str] = None,
  environment: typing.Mapping[str] = None,
  local: ILocalBundling = None,
  network: str = None,
  output_type: BundlingOutput = None,
  platform: str = None,
  security_opt: str = None,
  user: str = None,
  volumes: typing.List[DockerVolume] = None,
  volumes_from: typing.List[str] = None,
  working_directory: str = None
) -> bool

This method is called before attempting docker bundling to allow the bundler to be executed locally.

If the local bundler exists, and bundling was performed locally, return true. Otherwise, return false.

output_dirRequired

  • Type: str

the directory where the bundled asset should be output.


imageRequired

The Docker image where the command will run.


bundling_file_accessOptional

The access mechanism used to make source files available to the bundling container and to return the bundling output back to the host.


commandOptional

  • Type: typing.List[str]
  • Default: run the command defined in the image

The command to run in the Docker container.

Example value: ['npm', 'install']

https://docs.docker.com/engine/reference/run/


entrypointOptional

  • Type: typing.List[str]
  • Default: run the entrypoint defined in the image

The entrypoint to run in the Docker container.

Example value: ['/bin/sh', '-c']

https://docs.docker.com/engine/reference/builder/#entrypoint


environmentOptional

  • Type: typing.Mapping[str]
  • Default: no environment variables.

The environment variables to pass to the Docker container.


localOptional

  • Type: ILocalBundling
  • Default: bundling will only be performed in a Docker container

Local bundling provider.

The provider implements a method tryBundle() which should return true if local bundling was performed. If false is returned, docker bundling will be done.


networkOptional

  • Type: str
  • Default: no networking options

Docker Networking options.


output_typeOptional

The type of output that this bundling operation is producing.


platformOptional

  • Type: str
  • Default: no platform specified (the current machine architecture will be used)

Platform to build for. Requires Docker Buildx.

Specify this property to build images on a specific platform.


security_optOptional

  • Type: str
  • Default: no security options

Security configuration when running the docker container.


userOptional

  • Type: str
  • Default: uid:gid of the current user or 1000:1000 on Windows

The user to use when running the Docker container.

user | user:group | uid | uid:gid | user:gid | uid:group

https://docs.docker.com/engine/reference/run/#user


volumesOptional

  • Type: typing.List[DockerVolume]
  • Default: no additional volumes are mounted

Additional Docker volumes to mount.


volumes_fromOptional

  • Type: typing.List[str]
  • Default: no containers are specified to mount volumes from

Where to mount the specified volumes from.

https://docs.docker.com/engine/reference/commandline/run/#mount-volumes-from-container---volumes-from


working_directoryOptional

  • Type: str
  • Default: /asset-input

Working directory inside the Docker container.