podman_rest_client/v5/models/container_storage_config.rs
1use serde::{Deserialize, Serialize};
2#[derive(Default, Debug, Serialize, Deserialize)]
3/// ContainerStorageConfig contains information on the storage configuration of a
4/// container.
5pub struct ContainerStorageConfig {
6 /// ChrootDirs is an additional set of directories that need to be
7 /// treated as root directories. Standard bind mounts will be mounted
8 /// into paths relative to these directories.
9 /// Optional.
10 pub chroot_directories: Option<Vec<String>>,
11 /// Create the working directory if it doesn't exist.
12 /// If unset, it doesn't create it.
13 /// Optional.
14 pub create_working_dir: Option<bool>,
15 /// DeviceCgroupRule are device cgroup rules that allow containers
16 /// to use additional types of devices.
17 pub device_cgroup_rule: Option<Vec<crate::v5::models::LinuxDeviceCgroup>>,
18 /// Devices are devices that will be added to the container.
19 /// Optional.
20 pub devices: Option<Vec<crate::v5::models::LinuxDevice>>,
21 /// DevicesFrom specifies that this container will mount the device(s) from other container(s).
22 /// Optional.
23 pub devices_from: Option<Vec<String>>,
24 /// HostDeviceList is used to recreate the mounted device on inherited containers
25 pub host_device_list: Option<Vec<crate::v5::models::LinuxDevice>>,
26 /// Image is the image the container will be based on. The image will be
27 /// used as the container's root filesystem, and its environment vars,
28 /// volumes, and other configuration will be applied to the container.
29 /// Conflicts with Rootfs.
30 /// At least one of Image or Rootfs must be specified.
31 pub image: Option<String>,
32 /// ImageArch is the user-specified image architecture.
33 /// Used to select a different variant from a manifest list.
34 /// Optional.
35 pub image_arch: Option<String>,
36 /// ImageOS is the user-specified OS of the image.
37 /// Used to select a different variant from a manifest list.
38 /// Optional.
39 pub image_os: Option<String>,
40 /// ImageVariant is the user-specified image variant.
41 /// Used to select a different variant from a manifest list.
42 /// Optional.
43 pub image_variant: Option<String>,
44 /// ImageVolumeMode indicates how image volumes will be created.
45 /// Supported modes are "ignore" (do not create), "tmpfs" (create as
46 /// tmpfs), and "anonymous" (create as anonymous volumes).
47 /// The default if unset is anonymous.
48 /// Optional.
49 pub image_volume_mode: Option<String>,
50 /// Image volumes bind-mount a container-image mount into the container.
51 /// Optional.
52 pub image_volumes: Option<Vec<crate::v5::models::ImageVolume>>,
53 /// Init specifies that an init binary will be mounted into the
54 /// container, and will be used as PID1.
55 /// Optional.
56 pub init: Option<bool>,
57 /// InitPath specifies the path to the init binary that will be added if
58 /// Init is specified above. If not specified, the default set in the
59 /// Libpod config will be used. Ignored if Init above is not set.
60 /// Optional.
61 pub init_path: Option<String>,
62 pub ipcns: Option<crate::v5::models::Namespace>,
63 /// Mounts are mounts that will be added to the container.
64 /// These will supersede Image Volumes and VolumesFrom volumes where
65 /// there are conflicts.
66 /// Optional.
67 pub mounts: Option<Vec<crate::v5::models::Mount>>,
68 /// Overlay volumes are named volumes that will be added to the container.
69 /// Optional.
70 pub overlay_volumes: Option<Vec<crate::v5::models::OverlayVolume>>,
71 /// RawImageName is the user-specified and unprocessed input referring
72 /// to a local or a remote image.
73 /// Optional, but strongly encouraged to be set if Image is set.
74 pub raw_image_name: Option<String>,
75 /// Rootfs is the path to a directory that will be used as the
76 /// container's root filesystem. No modification will be made to the
77 /// directory, it will be directly mounted into the container as root.
78 /// Conflicts with Image.
79 /// At least one of Image or Rootfs must be specified.
80 pub rootfs: Option<String>,
81 /// RootfsMapping specifies if there are UID/GID mappings to apply to the rootfs.
82 /// Optional.
83 pub rootfs_mapping: Option<String>,
84 /// RootfsOverlay tells if rootfs is actually an overlay on top of base path.
85 /// Optional.
86 pub rootfs_overlay: Option<bool>,
87 /// RootfsPropagation is the rootfs propagation mode for the container.
88 /// If not set, the default of rslave will be used.
89 /// Optional.
90 pub rootfs_propagation: Option<String>,
91 /// Secrets are the secrets that will be added to the container
92 /// Optional.
93 pub secrets: Option<Vec<crate::v5::models::Secret>>,
94 /// ShmSize is the size of the tmpfs to mount in at /dev/shm, in bytes.
95 /// Conflicts with ShmSize if IpcNS is not private.
96 /// Optional.
97 pub shm_size: Option<i64>,
98 /// ShmSizeSystemd is the size of systemd-specific tmpfs mounts
99 /// specifically /run, /run/lock, /var/log/journal and /tmp.
100 /// Optional
101 pub shm_size_systemd: Option<i64>,
102 /// StorageOpts is the container's storage options
103 /// Optional.
104 pub storage_opts: Option<std::collections::HashMap<String, String>>,
105 /// Volatile specifies whether the container storage can be optimized
106 /// at the cost of not syncing all the dirty files in memory.
107 /// Optional.
108 pub volatile: Option<bool>,
109 /// Volumes are named volumes that will be added to the container.
110 /// These will supersede Image Volumes and VolumesFrom volumes where
111 /// there are conflicts.
112 /// Optional.
113 pub volumes: Option<Vec<crate::v5::models::NamedVolume>>,
114 /// VolumesFrom is a set of containers whose volumes will be added to
115 /// this container. The name or ID of the container must be provided, and
116 /// may optionally be followed by a : and then one or more
117 /// comma-separated options. Valid options are 'ro', 'rw', and 'z'.
118 /// Options will be used for all volumes sourced from the container.
119 /// Optional.
120 pub volumes_from: Option<Vec<String>>,
121 /// WorkDir is the container's working directory.
122 /// If unset, the default, /, will be used.
123 /// Optional.
124 pub work_dir: Option<String>,
125}