interface BundlingOptions
Language | Type name |
---|---|
.NET | Amazon.CDK.BundlingOptions |
Java | software.amazon.awscdk.core.BundlingOptions |
Python | aws_cdk.core.BundlingOptions |
TypeScript (source) | @aws-cdk/core » BundlingOptions |
Bundling options.
Example
const asset = new assets.Asset(this, 'BundledAsset', {
path: path.join(__dirname, 'markdown-asset'), // /asset-input and working directory in the container
bundling: {
image: DockerImage.fromBuild(path.join(__dirname, 'alpine-markdown')), // Build an image
command: [
'sh', '-c', `
markdown index.md > /asset-output/index.html
`,
],
},
});
Properties
Name | Type | Description |
---|---|---|
image | Docker | The Docker image where the command will run. |
command? | string[] | The command to run in the Docker container. |
entrypoint? | string[] | The entrypoint to run in the Docker container. |
environment? | { [string]: string } | The environment variables to pass to the Docker container. |
local? | ILocal | Local bundling provider. |
output | Bundling | The type of output that this bundling operation is producing. |
security | string | Security configuration when running the docker container. |
user? | string | The user to use when running the Docker container. |
volumes? | Docker [] | Additional Docker volumes to mount. |
working | string | Working directory inside the Docker container. |
image
Type:
Docker
The Docker image where the command will run.
command?
Type:
string[]
(optional, default: run the command defined in the image)
The command to run in the Docker container.
Example value: ['npm', 'install']
See also: https://docs.docker.com/engine/reference/run/
entrypoint?
Type:
string[]
(optional, default: run the entrypoint defined in the image)
The entrypoint to run in the Docker container.
Example value: ['/bin/sh', '-c']
See also: https://docs.docker.com/engine/reference/builder/#entrypoint
environment?
Type:
{ [string]: string }
(optional, default: no environment variables.)
The environment variables to pass to the Docker container.
local?
Type:
ILocal
(optional, 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.
outputType?
Type:
Bundling
(optional, default: BundlingOutput.AUTO_DISCOVER)
The type of output that this bundling operation is producing.
securityOpt?
Type:
string
(optional, default: no security options)
Security configuration when running the docker container.
user?
Type:
string
(optional, 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
See also: https://docs.docker.com/engine/reference/run/#user
volumes?
Type:
Docker
[]
(optional, default: no additional volumes are mounted)
Additional Docker volumes to mount.
workingDirectory?
Type:
string
(optional, default: /asset-input)
Working directory inside the Docker container.