public static final class DockerImageAsset.Builder
extends java.lang.Object
DockerImageAsset
.Modifier and Type | Method and Description |
---|---|
DockerImageAsset |
build() |
DockerImageAsset.Builder |
buildArgs(java.util.Map<java.lang.String,java.lang.String> buildArgs)
Build args to pass to the `docker build` command.
|
static DockerImageAsset.Builder |
create(software.constructs.Construct scope,
java.lang.String id) |
DockerImageAsset.Builder |
directory(java.lang.String directory)
The directory where the Dockerfile is stored.
|
DockerImageAsset.Builder |
exclude(java.util.List<java.lang.String> exclude)
Glob patterns to exclude from the copy.
|
DockerImageAsset.Builder |
extraHash(java.lang.String extraHash)
Extra information to encode into the fingerprint (e.g.
|
DockerImageAsset.Builder |
file(java.lang.String file)
Path to the Dockerfile (relative to the directory).
|
DockerImageAsset.Builder |
follow(FollowMode follow)
Deprecated.
use `followSymlinks` instead
|
DockerImageAsset.Builder |
followSymlinks(SymlinkFollowMode followSymlinks)
A strategy for how to handle symlinks.
|
DockerImageAsset.Builder |
ignoreMode(IgnoreMode ignoreMode)
The ignore behavior to use for exclude patterns.
|
DockerImageAsset.Builder |
invalidation(DockerImageAssetInvalidationOptions invalidation)
Options to control which parameters are used to invalidate the asset hash.
|
DockerImageAsset.Builder |
networkMode(NetworkMode networkMode)
Networking mode for the RUN commands during build.
|
DockerImageAsset.Builder |
platform(Platform platform)
Platform to build for.
|
DockerImageAsset.Builder |
repositoryName(java.lang.String repositoryName)
Deprecated.
to control the location of docker image assets, please override
`Stack.addDockerImageAsset`. this feature will be removed in future
releases.
|
DockerImageAsset.Builder |
target(java.lang.String target)
Docker target to build to.
|
public static DockerImageAsset.Builder create(software.constructs.Construct scope, java.lang.String id)
scope
- This parameter is required.id
- This parameter is required.DockerImageAsset.Builder
.public DockerImageAsset.Builder exclude(java.util.List<java.lang.String> exclude)
Default: - nothing is excluded
exclude
- Glob patterns to exclude from the copy. This parameter is required.this
@Deprecated public DockerImageAsset.Builder follow(FollowMode follow)
Default: Never
follow
- A strategy for how to handle symlinks. This parameter is required.this
public DockerImageAsset.Builder ignoreMode(IgnoreMode ignoreMode)
Default: IgnoreMode.GLOB
ignoreMode
- The ignore behavior to use for exclude patterns. This parameter is required.this
public DockerImageAsset.Builder extraHash(java.lang.String extraHash)
Default: - hash is only based on source content
extraHash
- Extra information to encode into the fingerprint (e.g. build instructions and other inputs). This parameter is required.this
public DockerImageAsset.Builder followSymlinks(SymlinkFollowMode followSymlinks)
Default: SymlinkFollowMode.NEVER
followSymlinks
- A strategy for how to handle symlinks. This parameter is required.this
public DockerImageAsset.Builder buildArgs(java.util.Map<java.lang.String,java.lang.String> buildArgs)
Since Docker build arguments are resolved before deployment, keys and
values cannot refer to unresolved tokens (such as lambda.functionArn
or
queue.queueUrl
).
Default: - no build args are passed
buildArgs
- Build args to pass to the `docker build` command. This parameter is required.this
public DockerImageAsset.Builder file(java.lang.String file)
Default: 'Dockerfile'
file
- Path to the Dockerfile (relative to the directory). This parameter is required.this
public DockerImageAsset.Builder invalidation(DockerImageAssetInvalidationOptions invalidation)
Default: - hash all parameters
invalidation
- Options to control which parameters are used to invalidate the asset hash. This parameter is required.this
public DockerImageAsset.Builder networkMode(NetworkMode networkMode)
Support docker API 1.25+.
Default: - no networking mode specified (the default networking mode `NetworkMode.DEFAULT` will be used)
networkMode
- Networking mode for the RUN commands during build. This parameter is required.this
public DockerImageAsset.Builder platform(Platform platform)
Requires Docker Buildx.
Default: - no platform specified (the current machine architecture will be used)
platform
- Platform to build for. This parameter is required.this
@Deprecated public DockerImageAsset.Builder repositoryName(java.lang.String repositoryName)
Specify this property if you need to statically address the image, e.g. from a Kubernetes Pod. Note, this is only the repository name, without the registry and the tag parts.
Default: - the default ECR repository for CDK assets
repositoryName
- ECR repository name. This parameter is required.this
public DockerImageAsset.Builder target(java.lang.String target)
Default: - no target
target
- Docker target to build to. This parameter is required.this
public DockerImageAsset.Builder directory(java.lang.String directory)
Any directory inside with a name that matches the CDK output folder (cdk.out by default) will be excluded from the asset
directory
- The directory where the Dockerfile is stored. This parameter is required.this
public DockerImageAsset build()