Struct ImageBuild

Source
pub struct ImageBuild<'a> {
Show 26 fields pub content_type: Option<&'a str>, pub x_registry_config: Option<&'a str>, pub dockerfile: Option<&'a str>, pub t: Option<&'a str>, pub extrahosts: Option<&'a str>, pub remote: Option<&'a str>, pub q: Option<bool>, pub nocache: Option<bool>, pub cachefrom: Option<&'a str>, pub pull: Option<bool>, pub rm: Option<bool>, pub forcerm: Option<bool>, pub memory: Option<i64>, pub memswap: Option<i64>, pub cpushares: Option<i64>, pub cpusetcpus: Option<&'a str>, pub cpuperiod: Option<i64>, pub cpuquota: Option<i64>, pub buildargs: Option<&'a str>, pub shmsize: Option<i64>, pub squash: Option<bool>, pub labels: Option<&'a str>, pub networkmode: Option<&'a str>, pub platform: Option<&'a str>, pub target: Option<&'a str>, pub outputs: Option<&'a str>,
}
Available on crate feature v5 only.

Fields§

§content_type: Option<&'a str>§x_registry_config: Option<&'a str>§dockerfile: Option<&'a str>

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

§t: Option<&'a str>

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.

§extrahosts: Option<&'a str>

TBD Extra hosts to add to /etc/hosts (As of version 1.xx)

§remote: Option<&'a str>

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. (As of version 1.xx)

§q: Option<bool>

Suppress verbose build output

§nocache: Option<bool>

Do not use the cache when building the image (As of version 1.xx)

§cachefrom: Option<&'a str>

JSON array of images used to build cache resolution (As of version 1.xx)

§pull: Option<bool>

Attempt to pull the image even if an older image exists locally (As of version 1.xx)

§rm: Option<bool>

Remove intermediate containers after a successful build (As of version 1.xx)

§forcerm: Option<bool>

Always remove intermediate containers, even upon failure (As of version 1.xx)

§memory: Option<i64>

Memory is the upper limit (in bytes) on how much memory running containers can use (As of version 1.xx)

§memswap: Option<i64>

MemorySwap limits the amount of memory and swap together (As of version 1.xx)

§cpushares: Option<i64>

CPUShares (relative weight (As of version 1.xx)

§cpusetcpus: Option<&'a str>

CPUSetCPUs in which to allow execution (0-3, 0,1) (As of version 1.xx)

§cpuperiod: Option<i64>

CPUPeriod limits the CPU CFS (Completely Fair Scheduler) period (As of version 1.xx)

§cpuquota: Option<i64>

CPUQuota limits the CPU CFS (Completely Fair Scheduler) quota (As of version 1.xx)

§buildargs: Option<&'a str>

JSON map of string pairs denoting build-time variables. For example, the build argument Foo with the value of bar would be encoded in JSON as ["Foo":"bar"].

For example, buildargs={“Foo”:“bar”}.

Note(s):

  • This should not be used to pass secrets.
  • The value of buildargs should be URI component encoded before being passed to the API.

(As of version 1.xx)

§shmsize: Option<i64>

ShmSize is the “size” value to use when mounting an shmfs on the container’s /dev/shm directory. Default is 64MB (As of version 1.xx)

§squash: Option<bool>

Silently ignored. Squash the resulting images layers into a single layer (As of version 1.xx)

§labels: Option<&'a str>

JSON map of key, value pairs to set as labels on the new image (As of version 1.xx)

§networkmode: Option<&'a str>

Sets the networking mode for the run commands during build. Supported standard values are:

  • bridge limited to containers within a single host, port mapping required for external access
  • host no isolation between host and containers on this network
  • none disable all networking for this container
  • container: share networking with given container —All other values are assumed to be a custom network’s name (As of version 1.xx)
§platform: Option<&'a str>

Platform format os[/arch[/variant]] (As of version 1.xx)

§target: Option<&'a str>

Target build stage (As of version 1.xx)

§outputs: Option<&'a str>

output configuration TBD (As of version 1.xx)

Trait Implementations§

Source§

impl<'a> Debug for ImageBuild<'a>

Source§

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

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

impl<'a> Default for ImageBuild<'a>

Source§

fn default() -> ImageBuild<'a>

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

Auto Trait Implementations§

§

impl<'a> Freeze for ImageBuild<'a>

§

impl<'a> RefUnwindSafe for ImageBuild<'a>

§

impl<'a> Send for ImageBuild<'a>

§

impl<'a> Sync for ImageBuild<'a>

§

impl<'a> Unpin for ImageBuild<'a>

§

impl<'a> UnwindSafe for ImageBuild<'a>

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> 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> Same for T

Source§

type Output = T

Should always be Self
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> ErasedDestructor for T
where T: 'static,