Struct podman_api::opts::ContainerCreateOptsBuilder [−][src]
pub struct ContainerCreateOptsBuilder { /* fields omitted */ }
Expand description
A builder struct for ContainerCreateOpts.
Implementations
Finish building ContainerCreateOpts.
Annotations are key-value options passed into the container runtime that can be used to trigger special behavior.
ApparmorProfile is the name of the Apparmor profile the container will use.
pub fn add_capabilities<I, S>(self, add_capabilities: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
pub fn add_capabilities<I, S>(self, add_capabilities: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
Capabilities which will be added to the container. Conflicts with
privileged
.
pub fn drop_capabilities<I, S>(self, drop_capabilities: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
pub fn drop_capabilities<I, S>(self, drop_capabilities: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
Capabilities which will be removed from the container. Conflicts with
privileged
.
Set the container’s CGroup parent. If not set, the default for the current cgroup driver will be used.
Namespace to use for cgroups.
Sets a policy for how cgroups will be created in the container, including the ability to disable creation entirely.
Command that the container should run. If not given and Image is specified, this will be populated by the image’s configuration.
A path at which a PID file for Conmon will be placed. If not given, a default location will be used.
pub fn create_command<I, S>(self, create_command: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
pub fn create_command<I, S>(self, create_command: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
The command that was used to create this container. This will be returned when inspecting the container.
CPU period of the cpuset
Create the working directory if it doesn’t exist. If unset, it doesn’t create it.
pub fn dependency_containers<I, S>(self, dependency_containers: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
pub fn dependency_containers<I, S>(self, dependency_containers: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
An array of containers this container depends on. Dependency containers must be started before this container. Dependencies can be specified by name or full/partial ID.
pub fn devices_from<I, S>(self, devices_from: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
pub fn devices_from<I, S>(self, devices_from: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
A way to ensure your container inherits device specific information from another container.
pub fn dns_option<I, S>(self, dns_option: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
pub fn dns_option<I, S>(self, dns_option: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
A set of DNS options that will be used in the container’s resolv.conf, replacing the host’s
DNS options which are used by default. Conflicts with
use_image_resolv_conf
.
pub fn dns_search<I, S>(self, dns_search: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
pub fn dns_search<I, S>(self, dns_search: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
A set of DNS search domains that will be used in the container’s resolv.conf, replacing
the host’s DNS search domains which are used by default. Conflicts with
use_image_resolv_conf
.
pub fn dns_server<I, S>(self, dns_server: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
pub fn dns_server<I, S>(self, dns_server: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
A set of DNS servers that will be used in the container’s resolv.conf, replacing the
host’s DNS Servers which are used by default. Conflicts with
use_image_resolv_conf
.
pub fn entrypoint<I, S>(self, entrypoint: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
pub fn entrypoint<I, S>(self, entrypoint: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
Container’s entrypoint. If not given and Image is specified, this will be populated by the image’s configuration.
A list of environment variables that will be set in the container.
Indicates that the host environment should be added to container.
Health config which holds configuration settings for the HEALTHCHECK feature, from docker/docker/api/types/container.
A set of hosts which will be added to the container’s etc/hosts file. Conflicts with
use_image_hosts
.
If not set, the hostname will not be modified (if UtsNS is not private) or will be set to the container ID (if UtsNS is private). Conflicts with UtsNS if UtsNS is not set to private.
Indicates that the http host proxy environment variables should be added to container.
Used for specifying how ID mapping should be set up for a layer or container.
Indicates how image volumes will be created. The default if unset is
anonymous
.
Specifies that an init binary will be mounted into the container, and will be used as PID1.
Describes if this container is an init container and if so, what type: always or once.
Namespace to use for IPC.
A list of labels that will be assigned to the container.
Logging configuration for the container.
The path we want to mask in the container. This masks the paths given in addition to the default list.
The name the container will be given. If no name is provided, one will be randomly generated.
The libpod namespace the container will be placed in.
Namespace to use for network.
Additional options for each network.
Whether the container will set the no new privileges flag on create, which disables gaining additional privileges (e.g. via setuid) in the container.
The name of the OCI runtime that will be used to create the container. If not specified, the default will be used.
Adjusts the score used by the OOM killer to determine processes to kill for the container’s process.
Specify the Linux personality syscall input.
Namespace to use for pids.
ID of the pod the container should join.
Whether the container is privileged. Privileged does the following: Adds all devices on the system to the container. Adds all capabilities to the container. Disables Seccomp, SELinux, and Apparmor confinement. (Though SELinux can be manually re-enabled).
pub fn procfs_opts<I, S>(self, procfs_opts: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
pub fn procfs_opts<I, S>(self, procfs_opts: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
The options used for the proc mount.
If set to true the ports specified in the image will be published to random unused ports
(guaranteed to be above 1024) on the host. This is based on ports set in Expose below,
and any ports specified by the Image (if one is given). Only available if
net_namespace
is set to Bridge or Slirp.
The user-specified and unprocessed input referring to a local or a remote image.
If set to true everything will be mounted as read-only.
If set to true the container will be removed upon exitting.
Set the container runtime resource contstraints.
An action which will be taken when the container exits. If not given, the default policy, which does nothing, will be used.
The number of attempts that will be made to restart the container. Only available
when restart_policy
is set to on-failure
.
Tells if rootfs is actuall an overlay on top of base path.
The rootfs propagation mode for the container. If not set, the default of rslave will be used.
Determine how to handle NOTIFY_SOCKET
.
Determines which seccomp profile gets applied the container.
The path to a JSON file containing the container’s Seccomp profile. If not specified, no Seccomp profile will be used.
A list of secrets that will be set as environment variables.
pub fn selinux_opts<I, S>(self, selinux_opts: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
pub fn selinux_opts<I, S>(self, selinux_opts: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
The process label the container will use. if SELinux is enabled and this is not specified, a label will be automatically generated if not specified.
The size of the tmpfs to mount in at /dev/shm, in bytes.
A number describing a process signal.
A timeout between the container’s stop signal being sent and SIGKILL being sent. If not provided, the default will be used. If 0 is used, stop signal will not be sent, and SIGKILL will be sent instead.
A list of container’s storage options.
A list of kernel parameters to set in the container.
A maximum time in seconds the container will run before main process is sent SIGKILL. If 0 is used, signal will not be sent.
The timezone inside the container. Local means it has the same timezone as the host machine.
The umask the init process of the container will be run with.
A list of key-value options passed into the container runtime that are used to configure cgroup v2.
The path we want to unmask in the container. To override all the default paths that are masked, set unmask=ALL.
A list of environment variables to unset if specified in the image or from buildin or containers.conf
If true all environment variables from the image or from buldin or containers.conf will get unset.
Indicates that /etc/hosts should not be managed by Podman, and instead sourced from the image.
Conflicts with hosts_add
.
Indicates that /etc/hosts should not be managed by Podman, and instead sourced from the image.
Conflicts with dns_server
,
dns_search
,
dns_option
.
The user the container will be run as. Can be given as a UID or a username; if a username, it will be resolved within the container, using the container’s /etc/passwd. If unset, the container will be run as root.
Namespace to use for users.
Namespace to use for uts.
Specifies whether the container storage can be optimized at the cost of not syncing all the dirty files in memory.
pub fn volumes_from<I, S>(self, volumes_from: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
pub fn volumes_from<I, S>(self, volumes_from: I) -> Self where
I: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
Set of containers whose volumes will be added to this container. The name or ID of the container must be provided, and may optionally be followed by a : and then one or more comma-separated options. Valid options are ‘ro’, ‘rw’, and ‘z’. Options will be used for all volumes sourced from the container.
Weight per cgroup per device.
Trait Implementations
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for ContainerCreateOptsBuilder
impl Send for ContainerCreateOptsBuilder
impl Sync for ContainerCreateOptsBuilder
impl Unpin for ContainerCreateOptsBuilder
impl UnwindSafe for ContainerCreateOptsBuilder
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more