Skip to content

DockerImageSource

Properties for how to produce a Docker image from a source.

Initializer

import "github.com/alibabacloud-go/ros-cdk/alicloudroscdkassemblyschema"
&alicloudroscdkassemblyschema.DockerImageSource {
    CacheDisabled: *bool,
    CacheFrom: *[]github.com/alibabacloud-go/ros-cdk/alicloudroscdkassemblyschema.DockerCacheOption,
    CacheTo: github.com/alibabacloud-go/ros-cdk/alicloudroscdkassemblyschema.DockerCacheOption,
    Directory: *string,
    DockerBuildArgs: *map[string]*string,
    DockerBuildSecrets: *map[string]*string,
    DockerBuildSsh: *string,
    DockerBuildTarget: *string,
    DockerFile: *string,
    DockerOutputs: *[]*string,
    Executable: *[]*string,
    NetworkMode: *string,
    Platform: *string,
}

Properties

Name Type Description
CacheDisabled *bool Disable the cache and pass --no-cache to the docker build command.
CacheFrom *[]DockerCacheOption Cache from options to pass to the docker build command.
CacheTo DockerCacheOption Cache to options to pass to the docker build command.
Directory *string The directory containing the Docker image build instructions.
DockerBuildArgs map[string]string Additional build arguments.
DockerBuildSecrets map[string]string Additional build secrets.
DockerBuildSsh *string SSH agent socket or keys.
DockerBuildTarget *string Target build stage in a Dockerfile with multiple build stages.
DockerFile *string The name of the file with build instructions.
DockerOutputs []string Outputs.
Executable []string A command-line executable that returns the name of a local Docker image on stdout after being run.
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.

CacheDisabledOptional

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

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


CacheFromOptional

CacheFrom *[]DockerCacheOption
  • Type: *[]DockerCacheOption
  • Default: no cache from options are passed to the build command

Cache from options to pass to the docker build command.

https://docs.docker.com/build/cache/backends/


CacheToOptional

CacheTo DockerCacheOption
  • Type: DockerCacheOption
  • Default: no cache to options are passed to the build command

Cache to options to pass to the docker build command.

https://docs.docker.com/build/cache/backends/


DirectoryOptional

Directory *string
  • Type: *string
  • Default: Exactly one of directory and executable is required

The directory containing the Docker image build instructions.

This path is relative to the asset manifest location.


DockerBuildArgsOptional

DockerBuildArgs *map[string]*string
  • Type: map[string]string
  • Default: No additional build arguments

Additional build arguments.

Only allowed when directory is set.


DockerBuildSecretsOptional

DockerBuildSecrets *map[string]*string
  • Type: map[string]string
  • Default: No additional build secrets

Additional build secrets.

Only allowed when directory is set.


DockerBuildSshOptional

DockerBuildSsh *string
  • Type: *string
  • Default: No ssh flag is set

SSH agent socket or keys.

Requires building with docker buildkit.


DockerBuildTargetOptional

DockerBuildTarget *string
  • Type: *string
  • Default: The last stage in the Dockerfile

Target build stage in a Dockerfile with multiple build stages.

Only allowed when directory is set.


DockerFileOptional

DockerFile *string
  • Type: *string
  • Default: "Dockerfile"

The name of the file with build instructions.

Only allowed when directory is set.


DockerOutputsOptional

DockerOutputs *[]*string
  • Type: []string
  • Default: no outputs are passed to the build command (default outputs are used)

Outputs.

https://docs.docker.com/engine/reference/commandline/build/#custom-build-outputs


ExecutableOptional

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

A command-line executable that returns the name of a local Docker image on stdout after being run.


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: current machine platform

Platform to build for. Requires Docker Buildx.

Specify this property to build images on a specific platform/architecture.