public static final class AssetImageCode.Builder
extends java.lang.Object
AssetImageCode
.Modifier and Type | Method and Description |
---|---|
AssetImageCode |
build() |
AssetImageCode.Builder |
buildArgs(java.util.Map<java.lang.String,java.lang.String> buildArgs)
Build args to pass to the `docker build` command.
|
AssetImageCode.Builder |
cmd(java.util.List<java.lang.String> cmd)
Specify or override the CMD on the specified Docker image or Dockerfile.
|
static AssetImageCode.Builder |
create(java.lang.String directory) |
AssetImageCode.Builder |
entrypoint(java.util.List<java.lang.String> entrypoint)
Specify or override the ENTRYPOINT on the specified Docker image or Dockerfile.
|
AssetImageCode.Builder |
exclude(java.util.List<java.lang.String> exclude)
Glob patterns to exclude from the copy.
|
AssetImageCode.Builder |
extraHash(java.lang.String extraHash)
Extra information to encode into the fingerprint (e.g.
|
AssetImageCode.Builder |
file(java.lang.String file)
Path to the Dockerfile (relative to the directory).
|
AssetImageCode.Builder |
follow(FollowMode follow)
Deprecated.
use `followSymlinks` instead
|
AssetImageCode.Builder |
followSymlinks(SymlinkFollowMode followSymlinks)
A strategy for how to handle symlinks.
|
AssetImageCode.Builder |
ignoreMode(IgnoreMode ignoreMode)
The ignore behavior to use for exclude patterns.
|
AssetImageCode.Builder |
invalidation(DockerImageAssetInvalidationOptions invalidation)
Options to control which parameters are used to invalidate the asset hash.
|
AssetImageCode.Builder |
networkMode(NetworkMode networkMode)
Networking mode for the RUN commands during build.
|
AssetImageCode.Builder |
platform(Platform platform)
Platform to build for.
|
AssetImageCode.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.
|
AssetImageCode.Builder |
target(java.lang.String target)
Docker target to build to.
|
AssetImageCode.Builder |
workingDirectory(java.lang.String workingDirectory)
Specify or override the WORKDIR on the specified Docker image or Dockerfile.
|
public static AssetImageCode.Builder create(java.lang.String directory)
directory
- This parameter is required.AssetImageCode.Builder
.public AssetImageCode.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 AssetImageCode.Builder follow(FollowMode follow)
Default: Never
follow
- A strategy for how to handle symlinks. This parameter is required.this
public AssetImageCode.Builder ignoreMode(IgnoreMode ignoreMode)
Default: IgnoreMode.GLOB
ignoreMode
- The ignore behavior to use for exclude patterns. This parameter is required.this
public AssetImageCode.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 AssetImageCode.Builder followSymlinks(SymlinkFollowMode followSymlinks)
Default: SymlinkFollowMode.NEVER
followSymlinks
- A strategy for how to handle symlinks. This parameter is required.this
public AssetImageCode.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 AssetImageCode.Builder file(java.lang.String file)
Default: 'Dockerfile'
file
- Path to the Dockerfile (relative to the directory). This parameter is required.this
public AssetImageCode.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 AssetImageCode.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 AssetImageCode.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 AssetImageCode.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 AssetImageCode.Builder target(java.lang.String target)
Default: - no target
target
- Docker target to build to. This parameter is required.this
public AssetImageCode.Builder cmd(java.util.List<java.lang.String> cmd)
This needs to be in the 'exec form', viz., [ 'executable', 'param1', 'param2' ]
.
Default: - use the CMD specified in the docker image or Dockerfile.
cmd
- Specify or override the CMD on the specified Docker image or Dockerfile. This parameter is required.this
public AssetImageCode.Builder entrypoint(java.util.List<java.lang.String> entrypoint)
An ENTRYPOINT allows you to configure a container that will run as an executable.
This needs to be in the 'exec form', viz., [ 'executable', 'param1', 'param2' ]
.
Default: - use the ENTRYPOINT in the docker image or Dockerfile.
entrypoint
- Specify or override the ENTRYPOINT on the specified Docker image or Dockerfile. This parameter is required.this
public AssetImageCode.Builder workingDirectory(java.lang.String workingDirectory)
A WORKDIR allows you to configure the working directory the container will use.
Default: - use the WORKDIR in the docker image or Dockerfile.
workingDirectory
- Specify or override the WORKDIR on the specified Docker image or Dockerfile. This parameter is required.this
public AssetImageCode build()