Skip to main content

DockerV2Config

Struct DockerV2Config 

Source
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 single image_templates list)
  • annotations map for OCI annotations (--annotation)
  • build_args map for build-time variables
  • skip as a StringOrBool template for conditional opt-out
  • sbom as a StringOrBool — when truthy, adds --sbom=true to buildx
  • flags for arbitrary extra docker build flags
  • platforms is 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: String

Path 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.

§tags: Vec<String>

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 of image:tag references for this build. Iterate via {% for img in Images %}{{ img }}{% endfor %} to mirror GR’s []string exposure 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 the BaseImage / BaseImageDigest overlay GR adds in internal/pipe/docker/v2/docker.go)

Trait Implementations§

Source§

impl Clone for DockerV2Config

Source§

fn clone(&self) -> DockerV2Config

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DockerV2Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DockerV2Config

Source§

fn default() -> DockerV2Config

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for DockerV2Config

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for DockerV2Config

Source§

fn schema_name() -> String

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more
Source§

impl Serialize for DockerV2Config

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,