pub struct ImageBuildOptsBuilder { /* private fields */ }
Expand description
A builder struct for ImageBuildOpts.
Implementations§
Source§impl ImageBuildOptsBuilder
impl ImageBuildOptsBuilder
Sourcepub fn all_platforms(self, all_platforms: bool) -> Self
pub fn all_platforms(self, all_platforms: bool) -> Self
Instead of building for a set of platforms specified using the platform option, inspect the build’s base images, and build for all of the platforms that are available. Stages that use scratch as a starting point can not be inspected, so at least one non-scratch stage must be present for detection to work usefully.
Sourcepub fn build_args<K, V>(
self,
build_args: impl IntoIterator<Item = (K, V)>,
) -> Self
pub fn build_args<K, V>( self, build_args: impl IntoIterator<Item = (K, V)>, ) -> Self
Key-value build time variables.
Sourcepub fn cache_from<S>(self, images: impl IntoIterator<Item = S>) -> Self
pub fn cache_from<S>(self, images: impl IntoIterator<Item = S>) -> Self
List of images used to build cache resolution
Sourcepub fn cpu_period(self, cpu_period: isize) -> Self
pub fn cpu_period(self, cpu_period: isize) -> Self
Limits the CPU CFS (Completely Fair Scheduler) period.
Sourcepub fn cpu_quota(self, cpu_quota: isize) -> Self
pub fn cpu_quota(self, cpu_quota: isize) -> Self
Limits the CPU CFS (Completely Fair Scheduler) quota.
Sourcepub fn cpu_set_cpus(self, cpu_set_cpus: isize) -> Self
pub fn cpu_set_cpus(self, cpu_set_cpus: isize) -> Self
Set CPUs in which to allow execution. Example: 0-1
, 1-3
CPU shares - relative weights
Sourcepub fn dockerfile(self, dockerfile: impl Into<String>) -> Self
pub fn dockerfile(self, dockerfile: impl Into<String>) -> Self
Path within the build context to the Dockerfile. This is ignored if remote is specified and points to an external 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.
Sourcepub fn force_rm(self, force_rm: bool) -> Self
pub fn force_rm(self, force_rm: bool) -> Self
Always remove intermediate containers, even upon failure.
Sourcepub fn http_proxy(self, http_proxy: bool) -> Self
pub fn http_proxy(self, http_proxy: bool) -> Self
Inject http proxy environment variables into container.
Sourcepub fn labels<K, V>(self, labels: impl IntoIterator<Item = (K, V)>) -> Self
pub fn labels<K, V>(self, labels: impl IntoIterator<Item = (K, V)>) -> Self
Key-value pairs to set as labels on the new image.
Sourcepub fn memory(self, memory: usize) -> Self
pub fn memory(self, memory: usize) -> Self
The upper limit (in bytes) on how much memory running containers can use.
Sourcepub fn network_mode(self, network_mode: NetworkMode) -> Self
pub fn network_mode(self, network_mode: NetworkMode) -> Self
Set the networking mode for the run commands during build.
pub fn platform(self, platform: Platform) -> Self
Sourcepub fn pull(self, pull: bool) -> Self
pub fn pull(self, pull: bool) -> Self
Attempt to pull the image even if an older image exists locally.
Sourcepub fn remote(self, remote: impl Into<String>) -> Self
pub fn remote(self, remote: impl Into<String>) -> Self
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.
Sourcepub fn remove(self, remove: bool) -> Self
pub fn remove(self, remove: bool) -> Self
Remove intermediate containers after a successful build.
Value to use when mounting an shmfs on the container’s /dev/shm directory. Default is 64MB
Sourcepub fn squash(self, squash: bool) -> Self
pub fn squash(self, squash: bool) -> Self
Silently ignored. Squash the resulting images layers into a single layer.
Sourcepub fn tag(self, tag: impl Into<String>) -> Self
pub fn tag(self, tag: impl Into<String>) -> Self
A name and optional tag to apply to the image in the name:tag
format.
Sourcepub fn unset_env<S>(self, unset_env: impl IntoIterator<Item = S>) -> Self
pub fn unset_env<S>(self, unset_env: impl IntoIterator<Item = S>) -> Self
Unset environment variables from the final image.
Trait Implementations§
Source§impl Clone for ImageBuildOptsBuilder
impl Clone for ImageBuildOptsBuilder
Source§fn clone(&self) -> ImageBuildOptsBuilder
fn clone(&self) -> ImageBuildOptsBuilder
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more