Class: DockerEngineAPI::Models::ImageBuildParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/docker_engine_api/models/image_build_params.rb

Overview

Defined Under Namespace

Modules: Version

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(body:, buildargs: nil, cachefrom: nil, cpuperiod: nil, cpuquota: nil, cpusetcpus: nil, cpushares: nil, dockerfile: nil, extrahosts: nil, forcerm: nil, labels: nil, memory: nil, memswap: nil, networkmode: nil, nocache: nil, outputs: nil, platform: nil, pull: nil, q: nil, remote: nil, rm: nil, shmsize: nil, squash: nil, t: nil, target: nil, version: nil, x_registry_config: nil, request_options: {}) ⇒ Object

Some parameter documentations has been truncated, see DockerEngineAPI::Models::ImageBuildParams for more details.

o

Parameters:

  • body (Pathname, StringIO, IO, String, DockerEngineAPI::FilePart)
  • buildargs (String) (defaults to: nil)

    JSON map of string pairs for build-time variables. Users pass these values at bu

  • cachefrom (String) (defaults to: nil)

    JSON array of images used for build cache resolution.

  • cpuperiod (Integer) (defaults to: nil)

    The length of a CPU period in microseconds.

  • cpuquota (Integer) (defaults to: nil)

    Microseconds of CPU time that the container can get in a CPU period.

  • cpusetcpus (String) (defaults to: nil)

    CPUs in which to allow execution (e.g., 0-3, ‘0,1`).

  • cpushares (Integer) (defaults to: nil)

    CPU shares (relative weight).

  • dockerfile (String) (defaults to: nil)

    Path within the build context to the Dockerfile. This is ignored if remote i

  • extrahosts (String) (defaults to: nil)

    Extra hosts to add to /etc/hosts

  • forcerm (Boolean) (defaults to: nil)

    Always remove intermediate containers, even upon failure.

  • labels (String) (defaults to: nil)

    Arbitrary key/value labels to set on the image, as a JSON map of string pairs.

  • memory (Integer) (defaults to: nil)

    Set memory limit for build.

  • memswap (Integer) (defaults to: nil)

    Total memory (memory + swap). Set as -1 to disable swap.

  • networkmode (String) (defaults to: nil)

    Sets the networking mode for the run commands during build. Supported

  • nocache (Boolean) (defaults to: nil)

    Do not use the cache when building the image.

  • outputs (String) (defaults to: nil)

    BuildKit output configuration in the format of a stringified JSON array of objec

  • platform (String) (defaults to: nil)

    Platform in the format os[/arch]

  • pull (String) (defaults to: nil)

    Attempt to pull the image even if an older image exists locally.

  • q (Boolean) (defaults to: nil)

    Suppress verbose build output.

  • remote (String) (defaults to: nil)

    A Git repository URI or HTTP/HTTPS context URI. If the URI points to a single te

  • rm (Boolean) (defaults to: nil)

    Remove intermediate containers after a successful build.

  • shmsize (Integer) (defaults to: nil)

    Size of /dev/shm in bytes. The size must be greater than 0. If omitted the sys

  • squash (Boolean) (defaults to: nil)

    Squash the resulting images layers into a single layer. *(Experimental release

  • t (String) (defaults to: nil)

    A name and optional tag to apply to the image in the name:tag format. If you o

  • target (String) (defaults to: nil)

    Target build stage

  • version (Symbol, DockerEngineAPI::Models::ImageBuildParams::Version) (defaults to: nil)

    Version of the builder backend to use.

  • x_registry_config (String) (defaults to: nil)
  • request_options (DockerEngineAPI::RequestOptions, Hash{Symbol=>Object}) (defaults to: {})


# File 'lib/docker_engine_api/models/image_build_params.rb', line 206


Instance Attribute Details

#bodyPathname, ...

Returns:



13
# File 'lib/docker_engine_api/models/image_build_params.rb', line 13

required :body, DockerEngineAPI::Internal::Type::FileInput

#buildargsString?

JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker uses the buildargs as the environment context for commands run via the Dockerfile RUN instruction, or for variable expansion in other Dockerfile instructions. This is not meant for passing secret values.

For example, the build arg ‘FOO=bar` would become `“FOO”:“bar”` in JSON. This would result in the query parameter `buildargs=“FOO”:“bar”`. Note that `“FOO”:“bar”` should be URI component encoded.

[Read more about the buildargs instruction.](docs.docker.com/engine/reference/builder/#arg)

Returns:

  • (String, nil)


28
# File 'lib/docker_engine_api/models/image_build_params.rb', line 28

optional :buildargs, String

#cachefromString?

JSON array of images used for build cache resolution.

Returns:

  • (String, nil)


34
# File 'lib/docker_engine_api/models/image_build_params.rb', line 34

optional :cachefrom, String

#cpuperiodInteger?

The length of a CPU period in microseconds.

Returns:

  • (Integer, nil)


40
# File 'lib/docker_engine_api/models/image_build_params.rb', line 40

optional :cpuperiod, Integer

#cpuquotaInteger?

Microseconds of CPU time that the container can get in a CPU period.

Returns:

  • (Integer, nil)


46
# File 'lib/docker_engine_api/models/image_build_params.rb', line 46

optional :cpuquota, Integer

#cpusetcpusString?

CPUs in which to allow execution (e.g., 0-3, ‘0,1`).

Returns:

  • (String, nil)


52
# File 'lib/docker_engine_api/models/image_build_params.rb', line 52

optional :cpusetcpus, String

#cpusharesInteger?

CPU shares (relative weight).

Returns:

  • (Integer, nil)


58
# File 'lib/docker_engine_api/models/image_build_params.rb', line 58

optional :cpushares, Integer

#dockerfileString?

Path within the build context to the Dockerfile. This is ignored if remote is specified and points to an external Dockerfile.

Returns:

  • (String, nil)


65
# File 'lib/docker_engine_api/models/image_build_params.rb', line 65

optional :dockerfile, String

#extrahostsString?

Extra hosts to add to /etc/hosts

Returns:

  • (String, nil)


71
# File 'lib/docker_engine_api/models/image_build_params.rb', line 71

optional :extrahosts, String

#forcermBoolean?

Always remove intermediate containers, even upon failure.

Returns:

  • (Boolean, nil)


77
# File 'lib/docker_engine_api/models/image_build_params.rb', line 77

optional :forcerm, DockerEngineAPI::Internal::Type::Boolean

#labelsString?

Arbitrary key/value labels to set on the image, as a JSON map of string pairs.

Returns:

  • (String, nil)


83
# File 'lib/docker_engine_api/models/image_build_params.rb', line 83

optional :labels, String

#memoryInteger?

Set memory limit for build.

Returns:

  • (Integer, nil)


89
# File 'lib/docker_engine_api/models/image_build_params.rb', line 89

optional :memory, Integer

#memswapInteger?

Total memory (memory + swap). Set as -1 to disable swap.

Returns:

  • (Integer, nil)


95
# File 'lib/docker_engine_api/models/image_build_params.rb', line 95

optional :memswap, Integer

#networkmodeString?

Sets the networking mode for the run commands during build. Supported standard values are: bridge, host, none, and ‘container:<name|id>`. Any other value is taken as a custom network’s name or ID to which this container should connect to.

Returns:

  • (String, nil)


104
# File 'lib/docker_engine_api/models/image_build_params.rb', line 104

optional :networkmode, String

#nocacheBoolean?

Do not use the cache when building the image.

Returns:

  • (Boolean, nil)


110
# File 'lib/docker_engine_api/models/image_build_params.rb', line 110

optional :nocache, DockerEngineAPI::Internal::Type::Boolean

#outputsString?

BuildKit output configuration in the format of a stringified JSON array of objects. Each object must have two top-level properties: Type and Attrs. The Type property must be set to ‘moby’. The Attrs property is a map of attributes for the BuildKit output configuration. See docs.docker.com/build/exporters/oci-docker/ for more information.

Example:

“‘

“Type”:“moby”,“Attrs”:{“type”:“image”,“force-compression”:“true”,“compression”:“zstd”}

“‘

Returns:

  • (String, nil)


126
# File 'lib/docker_engine_api/models/image_build_params.rb', line 126

optional :outputs, String

#platformString?

Platform in the format os[/arch]

Returns:

  • (String, nil)


132
# File 'lib/docker_engine_api/models/image_build_params.rb', line 132

optional :platform, String

#pullString?

Attempt to pull the image even if an older image exists locally.

Returns:

  • (String, nil)


138
# File 'lib/docker_engine_api/models/image_build_params.rb', line 138

optional :pull, String

#qBoolean?

Suppress verbose build output.

Returns:

  • (Boolean, nil)


144
# File 'lib/docker_engine_api/models/image_build_params.rb', line 144

optional :q, DockerEngineAPI::Internal::Type::Boolean

#remoteString?

A Git repository URI or HTTP/HTTPS context URI. If the URI points to a single text file, the file’s contents are placed into a file called Dockerfile and the image is built from that file. If the URI points to a tarball, the file is downloaded by the daemon and the contents therein used as the context for the build. If the URI points to a tarball and the dockerfile parameter is also specified, there must be a file with the corresponding path inside the tarball.

Returns:

  • (String, nil)


155
# File 'lib/docker_engine_api/models/image_build_params.rb', line 155

optional :remote, String

#rmBoolean?

Remove intermediate containers after a successful build.

Returns:

  • (Boolean, nil)


161
# File 'lib/docker_engine_api/models/image_build_params.rb', line 161

optional :rm, DockerEngineAPI::Internal::Type::Boolean

#shmsizeInteger?

Size of /dev/shm in bytes. The size must be greater than 0. If omitted the system uses 64MB.

Returns:

  • (Integer, nil)


168
# File 'lib/docker_engine_api/models/image_build_params.rb', line 168

optional :shmsize, Integer

#squashBoolean?

Squash the resulting images layers into a single layer. _(Experimental release only.)_

Returns:

  • (Boolean, nil)


175
# File 'lib/docker_engine_api/models/image_build_params.rb', line 175

optional :squash, DockerEngineAPI::Internal::Type::Boolean

#tString?

A name and optional tag to apply to the image in the name:tag format. If you omit the tag the default latest value is assumed. You can provide several t parameters.

Returns:

  • (String, nil)


183
# File 'lib/docker_engine_api/models/image_build_params.rb', line 183

optional :t, String

#targetString?

Target build stage

Returns:

  • (String, nil)


189
# File 'lib/docker_engine_api/models/image_build_params.rb', line 189

optional :target, String

#versionSymbol, ...

Version of the builder backend to use.

  • 1 is the first generation classic (deprecated) builder in the Docker daemon (default)

  • 2 is [BuildKit](github.com/moby/buildkit)



199
# File 'lib/docker_engine_api/models/image_build_params.rb', line 199

optional :version, enum: -> { DockerEngineAPI::ImageBuildParams::Version }

#x_registry_configString?

Returns:

  • (String, nil)


204
# File 'lib/docker_engine_api/models/image_build_params.rb', line 204

optional :x_registry_config, String