Skip to content

DockerImageAssetSource

Initializer

import "github.com/alibabacloud-go/ros-cdk/alicloudroscdkcore"
&alicloudroscdkcore.DockerImageAssetSource {
    SourceHash: *string,
    AssetName: *string,
    DirectoryName: *string,
    DockerBuildArgs: *map[string]*string,
    DockerBuildSACRets: *map[string]*string,
    DockerBuildSsh: *string,
    DockerBuildTarget: *string,
    DockerCacheDisabled: *bool,
    DockerCacheFrom: *[]github.com/alibabacloud-go/ros-cdk/alicloudroscdkcore.DockerCacheOption,
    DockerCacheTo: github.com/alibabacloud-go/ros-cdk/alicloudroscdkcore.DockerCacheOption,
    DockerFile: *string,
    DockerOutputs: *[]*string,
    Executable: *[]*string,
    NetworkMode: *string,
    Platform: *string,
}

Properties

Name Type Description
SourceHash *string The hash of the contents of the docker build context.
AssetName *string Unique identifier of the docker image asset and its potential revisions.
DirectoryName *string The directory where the Dockerfile is stored, must be relative to the cloud assembly root.
DockerBuildArgs map[string]string Build args to pass to the docker build command.
DockerBuildSACRets map[string]string Build sACRets to pass to the docker build command.
DockerBuildSsh *string SSH agent socket or keys to pass to the docker buildx command.
DockerBuildTarget *string Docker target to build to.
DockerCacheDisabled *bool Disable the cache and pass --no-cache to the docker build command.
DockerCacheFrom *[]DockerCacheOption Cache from options to pass to the docker build command.
DockerCacheTo DockerCacheOption Cache to options to pass to the docker build command.
DockerFile *string Path to the Dockerfile (relative to the directory).
DockerOutputs []string Outputs to pass to the docker build command.
Executable []string An external command that will produce the packaged asset.
NetworkMode *string Networking mode for the RUN commands during build. Requires Docker Engine API v1.25+.
Platform *string Platform to build for. Requires Docker Buildx.

SourceHashRequired

SourceHash *string
  • Type: *string

The hash of the contents of the docker build context.

This hash is used throughout the system to identify this image and avoid duplicate work in case the source did not change.

NOTE: this means that if you wish to update your docker image, you must make a modification to the source (e.g. add some metadata to your Dockerfile).


AssetNameOptional

AssetName *string
  • Type: *string
  • Default: no asset name

Unique identifier of the docker image asset and its potential revisions.

Required if using AppScopedStagingSynthesizer.


DirectoryNameOptional

DirectoryName *string
  • Type: *string
  • Default: Exactly one of directoryName and executable is required

The directory where the Dockerfile is stored, must be relative to the cloud assembly root.


DockerBuildArgsOptional

DockerBuildArgs *map[string]*string
  • Type: map[string]string
  • Default: no build args are passed

Build args to pass to the docker build command.

Since Docker build arguments are resolved before deployment, keys and values cannot refer to unresolved tokens.

Only allowed when directoryName is specified.


DockerBuildSACRetsOptional

DockerBuildSACRets *map[string]*string
  • Type: map[string]string
  • Default: no build sACRets are passed

Build sACRets to pass to the docker build command.

Since Docker build sACRets are resolved before deployment, keys and values cannot refer to unresolved tokens.

Only allowed when directoryName is specified.


DockerBuildSshOptional

DockerBuildSsh *string
  • Type: *string
  • Default: no ssh arg is passed

SSH agent socket or keys to pass to the docker buildx command.


DockerBuildTargetOptional

DockerBuildTarget *string
  • Type: *string
  • Default: no target

Docker target to build to.

Only allowed when directoryName is specified.


DockerCacheDisabledOptional

DockerCacheDisabled *bool
  • Type: *bool
  • Default: cache is used

Disable the cache and pass --no-cache to the docker build command.


DockerCacheFromOptional

DockerCacheFrom *[]DockerCacheOption

Cache from options to pass to the docker build command.


DockerCacheToOptional

DockerCacheTo DockerCacheOption

Cache to options to pass to the docker build command.


DockerFileOptional

DockerFile *string
  • Type: *string
  • Default: no file

Path to the Dockerfile (relative to the directory).

Only allowed when directoryName is specified.


DockerOutputsOptional

DockerOutputs *[]*string
  • Type: []string
  • Default: no build args are passed

Outputs to pass to the docker build command.


ExecutableOptional

Executable *[]*string
  • Type: []string
  • Default: Exactly one of directoryName and executable is required

An external command that will produce the packaged asset.

The command should produce the name of a local Docker image on stdout.


NetworkModeOptional

NetworkMode *string
  • Type: *string
  • Default: no networking mode specified

Networking mode for the RUN commands during build. Requires Docker Engine API v1.25+.

Specify this property to build images on a specific networking mode.


PlatformOptional

Platform *string
  • Type: *string
  • 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.