Image Build

Command Parameters

Build Directory

CLI FlagVariable NameConfig Field Name
--build-dirWFE_BUILD_DIRimage.buildDir

The directory from which to build the container (typically, but not always, the directory where the Dockerfile is located). This parameter is optional, expects a string value, and defaults to the current working directory.

Dockerfile

CLI FlagVariable NameConfig Field Name
--dockerfileWFE_BUILD_DOCKERFILEimage.buildDockerfile

Build Args

CLI FlagVariable NameConfig Field Name
--build-argWFE_BUILD_ARGSimage.buildArgs

Defines build arguments that are passed to the actual container image build command. This parameter is optional, and expects a mapping of string keys to string values, the exact format of which depends on the medium by which it is specified.

CLI Flag

The --build-arg flag can be specified multiple times to specify different args. The key and value for each arg should be specified as a string in the format key=value.

Environment Variable

The WFE_BUILD_ARGS environment variable must contain all the build arguments in a JSON formatted object (i.e. {"key":"value"}).

Configuration File

Similar to how build args are specified as an environment variable, build args in config files must be specified as a JSON formatted object. The following is an example YAML config file:

image:
  buildArgs: |-
    { "key": "value" }

Note that when specifying build args via the configuration file, special care must be taken to ensure that the case of the key is preserved. In the above example the value of buildArgs is a string, not a YAML object. When using a JSON config file this would need to be specified as follows:

{
	"image": {
		"buildArgs": "{ \"key\": \"value\" }"
	}
}

This is because the workflow-engine configuration file loader does not preserve the case of keys, and build args in Dockerfiles are case sensitive.

Tag

CLI FlagVariable NameConfig Field Name
--tagWFE_BUILD_TAGimage.buildTag

Platform

CLI FlagVariable NameConfig Field Name
--platformWFE_BUILD_PLATFORMimage.buildPlatform

Target

CLI FlagVariable NameConfig Field Name
--targetWFE_BUILD_TARGETimage.buildTarget

For multi-stage Dockerfiles this parameter specifies a named stage to build.

Cache To

CLI FlagVariable NameConfig Field Name
--cache-toWFE_BUILD_CACHE_TOimage.buildCacheTo

Cache From

CLI FlagVariable NameConfig Field Name
--cache-fromWFE_BUILD_CACHE_FROMimage.buildCacheFrom

Squash Layers

CLI FlagVariable NameConfig Field Name
--squash-layersWFE_BUILD_SQUASH_LAYERSimage.buildSquashLayers