Struct docker_api::opts::ImageBuildOptsBuilder
source · pub struct ImageBuildOptsBuilder { /* private fields */ }
Implementations§
source§impl ImageBuildOptsBuilder
impl ImageBuildOptsBuilder
sourcepub fn dockerfile(self, dockerfile: impl Into<String>) -> Self
pub fn dockerfile(self, dockerfile: impl Into<String>) -> Self
Set the name of the docker file. defaults to DockerFile
.
sourcepub fn extra_hosts(self, extra_hosts: impl Into<String>) -> Self
pub fn extra_hosts(self, extra_hosts: impl Into<String>) -> Self
Extra hosts to add to /etc/hosts.
pub fn remote(self, remote: impl Into<String>) -> Self
sourcepub fn pull(self, pull: impl Into<String>) -> Self
pub fn pull(self, pull: impl Into<String>) -> Self
Attempt to pull the image even if an older image exists locally.
pub fn rm(self, rm: bool) -> Self
pub fn forcerm(self, forcerm: bool) -> Self
sourcepub fn memswap(self, memswap: usize) -> Self
pub fn memswap(self, memswap: usize) -> Self
Total memory (memory + swap). Set as -1 to disable swap.
CPU shares (relative weight).
sourcepub fn cpu_set_cpus(self, cpu_set_cpus: impl Into<String>) -> Self
pub fn cpu_set_cpus(self, cpu_set_cpus: impl Into<String>) -> Self
CPUs in which to allow execution (eg. 0-3
, 0,1
)
sourcepub fn cpu_period(self, cpu_period: usize) -> Self
pub fn cpu_period(self, cpu_period: usize) -> Self
The length of a CPU period in microseconds.
sourcepub fn cpu_quota(self, cpu_quota: usize) -> Self
pub fn cpu_quota(self, cpu_quota: usize) -> Self
Microseconds of CPU time that the container can get in a CPU period.
sourcepub fn shm_size(self, shm_size: usize) -> Self
pub fn shm_size(self, shm_size: usize) -> Self
Size of /dev/shm in bytes. The size must be greater than 0. If omitted the system uses 64MB.
sourcepub fn squash(self, squash: bool) -> Self
pub fn squash(self, squash: bool) -> Self
Squash the resulting images layers into a single layer. (Experimental release only.)
sourcepub fn network_mode(self, network_mode: impl Into<String>) -> Self
pub fn network_mode(self, network_mode: impl Into<String>) -> Self
bridge,
host,
none,
container:<name|id>`, or a custom network name.
sourcepub fn platform(self, platform: impl Into<String>) -> Self
pub fn platform(self, platform: impl Into<String>) -> Self
Platform in the format os[/arch[/variant]].
sourcepub fn labels<K, V>(self, labels: impl IntoIterator<Item = (K, V)>) -> Selfwhere
K: Serialize + Eq + Hash,
V: Serialize,
pub fn labels<K, V>(self, labels: impl IntoIterator<Item = (K, V)>) -> Selfwhere K: Serialize + Eq + Hash, V: Serialize,
Add labels to this image.
pub fn build(&self) -> ImageBuildOpts
Trait Implementations§
source§impl Default for ImageBuildOptsBuilder
impl Default for ImageBuildOptsBuilder
source§fn default() -> ImageBuildOptsBuilder
fn default() -> ImageBuildOptsBuilder
Returns the “default value” for a type. Read more