pub struct DockerV2Config {Show 15 fields
pub id: Option<String>,
pub ids: Option<Vec<String>>,
pub dockerfile: String,
pub images: Vec<String>,
pub tags: Vec<String>,
pub labels: Option<HashMap<String, String>>,
pub annotations: Option<HashMap<String, String>>,
pub extra_files: Option<Vec<String>>,
pub platforms: Option<Vec<String>>,
pub build_args: Option<HashMap<String, String>>,
pub retry: Option<DockerRetryConfig>,
pub flags: Option<Vec<String>>,
pub skip: Option<StringOrBool>,
pub sbom: Option<StringOrBool>,
pub hooks: Option<BuildHooksConfig>,
}Expand description
Docker V2 configuration — the canonical Docker build API.
Notable surface:
images+tags(cleaner separation than a singleimage_templateslist)annotationsmap for OCI annotations (--annotation)build_argsmap for build-time variablesskipas aStringOrBooltemplate for conditional opt-outsbomas aStringOrBool— when truthy, adds--sbom=trueto buildxflagsfor arbitrary extradocker buildflagsplatformsis the only target selector — no per-arch field overrides
Fields§
§id: Option<String>Unique identifier for this Docker V2 config.
ids: Option<Vec<String>>Build IDs filter: only include binary artifacts whose metadata id is in this list.
dockerfile: StringPath to the Dockerfile relative to the project root.
images: Vec<String>Base image names (e.g., [“ghcr.io/owner/app”]). Combined with tags to form full references.
Tag suffixes (e.g., [“latest”, “{{ .Version }}”]). Each image is tagged with each tag.
labels: Option<HashMap<String, String>>OCI labels to apply to the image via --label key=value flags.
annotations: Option<HashMap<String, String>>OCI annotations to apply via --annotation key=value flags.
extra_files: Option<Vec<String>>Extra files to copy into the Docker build context.
platforms: Option<Vec<String>>Target platforms for multi-arch builds (e.g., [“linux/amd64”, “linux/arm64”]).
build_args: Option<HashMap<String, String>>Build arguments passed as --build-arg KEY=VALUE.
Each value is template-expanded and forwarded verbatim to buildx
(one argv token per pair, no shell tokenization). Prefer
{{ .Env.VAR }} over raw user-config strings for secrets — buildx
records build-args in image history by default, so plaintext values
here propagate into the image metadata.
retry: Option<DockerRetryConfig>Retry configuration for docker push operations.
flags: Option<Vec<String>>Arbitrary extra flags passed to the docker build command.
skip: Option<StringOrBool>When truthy, skip this docker build entirely. Supports templates.
Accepts the legacy disable: spelling via serde alias for back-compat
with imported GoReleaser configs (GR’s docker config field is
pkg/config/config.go:1149 Disable string).
sbom: Option<StringOrBool>When truthy, adds --sbom=true to buildx. Supports templates.
hooks: Option<BuildHooksConfig>Pre/post hooks for this docker_v2 config. Each hook accepts the same
cmd/dir/env/output shape as build/archive hooks. pre hooks
run after the staging directory is prepared but before docker buildx build; post hooks run after the image digest is captured. Hook
commands, working directories, and env values are template-expanded;
in addition to the standard template surface, hooks see:
{{ .Images }}— list ofimage:tagreferences for this build. Iterate via{% for img in Images %}{{ img }}{% endfor %}to mirror GR’s[]stringexposure of the same field;{{ .Images | join(sep=",") }}reproduces a flat comma-separated string for legacy templates.{{ .Dockerfile }}— path to the rendered Dockerfile{{ .ContextDir }}— path to the buildx context staging directory{{ .Digest }}— image manifest digest (post hooks only){{ .BaseImage }}/{{ .BaseImageDigest }}— final-stage base image (matches theBaseImage/BaseImageDigestoverlay GR adds ininternal/pipe/docker/v2/docker.go)
Trait Implementations§
Source§impl Clone for DockerV2Config
impl Clone for DockerV2Config
Source§fn clone(&self) -> DockerV2Config
fn clone(&self) -> DockerV2Config
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DockerV2Config
impl Debug for DockerV2Config
Source§impl Default for DockerV2Config
impl Default for DockerV2Config
Source§fn default() -> DockerV2Config
fn default() -> DockerV2Config
Source§impl<'de> Deserialize<'de> for DockerV2Configwhere
DockerV2Config: Default,
impl<'de> Deserialize<'de> for DockerV2Configwhere
DockerV2Config: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for DockerV2Config
impl JsonSchema for DockerV2Config
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read more