[][src]Struct wharf::opts::ImageBuilderOpts

pub struct ImageBuilderOpts { /* fields omitted */ }

Options for building an image

Methods

impl ImageBuilderOpts[src]

pub fn new() -> Self[src]

pub fn dockerfile(&mut self, path: &str) -> &mut Self[src]

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

pub fn name(&mut self, name: &str) -> &mut Self[src]

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.

pub fn remote(&mut self, repo: &str) -> &mut Self[src]

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.

pub fn extra_hosts(&mut self, hosts: &str) -> &mut Self[src]

Extra hosts to add to /etc/hosts

pub fn quiet(&mut self, q: bool) -> &mut Self[src]

Suppress verbose build output.

pub fn no_cache(&mut self, no_cache: bool) -> &mut Self[src]

Do not use the cache when building the image.

pub fn rm(&mut self, rm: bool) -> &mut Self[src]

Remove intermediate containers after a successful build.

pub fn forcerm(&mut self, force: bool) -> &mut Self[src]

Always remove intermediate containers, even upon failure.

pub fn memory(&mut self, limit: u64) -> &mut Self[src]

Set memory limit for build.

pub fn mem_swap(&mut self, swap: u64) -> &mut Self[src]

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

pub fn cpu_shares(&mut self, shares: u64) -> &mut Self[src]

CPU shares (relative weight).

pub fn cpusetcpus(&mut self, setcpus: &str) -> &mut Self[src]

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

pub fn cpu_period(&mut self, period: u64) -> &mut Self[src]

The length of a CPU period in microseconds.

pub fn cpu_quota(&mut self, quota: u64) -> &mut Self[src]

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

pub fn build_args(&mut self, args: &HashMap<&str, &str>) -> &mut Self[src]

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.

pub fn shmsize(&mut self, size: u64) -> &mut Self[src]

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

pub fn labels(&mut self, labels: &HashMap<&str, &str>) -> &mut Self[src]

Arbitrary key/value labels to set on the image

pub fn network_mode(&mut self, mode: &str) -> &mut Self[src]

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 to which this container should connect to.

pub fn platform(&mut self, p: &str) -> &mut Self[src]

Platform in the format os[/arch[/variant]]

pub fn target(&mut self, t: &str) -> &mut Self[src]

Target build stage

Trait Implementations

impl Default for ImageBuilderOpts[src]

impl DockerOpts for ImageBuilderOpts[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.