1containers.conf(5) configuration containers.conf(5)
2
3
4
6 containers.conf - The container engine configuration file specifies de‐
7 fault configuration options and command-line flags for container en‐
8 gines.
9
10
11
13 Container engines like Podman & Buildah read containers.conf file, if
14 it exists and modify the defaults for running containers on the host.
15 containers.conf uses a TOML format that can be easily modified and ver‐
16 sioned.
17
18
19 Container engines read the /usr/share/containers/containers.conf and
20 /etc/containers/containers.conf, and /etc/containers/contain‐
21 ers.conf.d/.conf files if they exist. When running in rootless mode,
22 they also read $HOME/.config/containers/containers.conf and $HOME/.con‐
23 fig/containers/containers.conf.d/.conf files.
24
25
26 Fields specified in containers conf override the default options, as
27 well as options in previously read containers.conf files.
28
29
30 Config files in the .d directories, are added in alpha numeric sorted
31 order and must end in .conf.
32
33
34 Not all options are supported in all container engines.
35
36
37 Note container engines also use other configuration files for configur‐
38 ing the environment.
39
40
41 • storage.conf for configuration of container and images stor‐
42 age.
43
44 • registries.conf for definition of container registires to
45 search while pulling. container images.
46
47 • policy.conf for controlling which images can be pulled to the
48 system.
49
50
51
52
54 The TOML format ⟨https://github.com/toml-lang/toml⟩ is used as the en‐
55 coding of the configuration file. Every option is nested under its ta‐
56 ble. No bare options are used. The format of TOML can be simplified to:
57
58
59 [table1]
60 option = value
61
62 [table2]
63 option = value
64
65 [table3]
66 option = value
67
68 [table3.subtable1]
69 option = value
70
71
72
74 The containers table contains settings to configure and manage the OCI
75 runtime.
76
77
78 annotations = [] List of annotations. Specified as "key=value" pairs to
79 be added to all containers.
80
81
82 Example: "run.oci.keep_original_groups=1"
83
84
85 apparmor_profile="container-default"
86
87
88 Used to change the name of the default AppArmor profile of container
89 engines. The default profile name is "container-default".
90
91
92 cgroups="enabled"
93
94
95 Determines whether the container will create CGroups. Options are:
96 enabled Enable cgroup support within container
97 disabled Disable cgroup support, will inherit cgroups from parent
98 no-conmon Do not create a cgroup dedicated to conmon.
99
100
101 cgroupns="private"
102
103
104 Default way to to create a cgroup namespace for the container. Options
105 are: private Create private Cgroup Namespace for the container. host
106 Share host Cgroup Namespace with the container.
107
108
109 default_capabilities=[]
110
111
112 List of default capabilities for containers.
113
114
115 The default list is:
116
117
118 default_capabilities = [
119 "AUDIT_WRITE",
120 "CHOWN",
121 "DAC_OVERRIDE",
122 "FOWNER",
123 "FSETID",
124 "KILL",
125 "MKNOD",
126 "NET_BIND_SERVICE",
127 "NET_RAW",
128 "SETGID",
129 "SETPCAP",
130 "SETUID",
131 "SYS_CHROOT",
132 ]
133
134
135
136 default_sysctls=[]
137
138
139 A list of sysctls to be set in containers by default, specified as
140 "name=value".
141
142
143 Example:"net.ipv4.ping_group_range=0 1000".
144
145
146 default_ulimits=[]
147
148
149 A list of ulimits to be set in containers by default, specified as
150 "name=soft-limit:hard-limit".
151
152
153 Example: "nofile=1024:2048".
154
155
156 devices=[]
157
158
159 List of devices. Specified as 'device-on-host:device-on-container:per‐
160 missions'.
161
162
163 Example: "/dev/sdc:/dev/xvdc:rwm".
164
165
166 dns_options=[]
167
168
169 List of default DNS options to be added to /etc/resolv.conf inside of
170 the container.
171
172
173 dns_searches=[]
174
175
176 List of default DNS search domains to be added to /etc/resolv.conf in‐
177 side of the container.
178
179
180 dns_servers=[]
181
182
183 A list of dns servers to override the DNS configuration passed to the
184 container. The special value “none” can be specified to disable cre‐
185 ation of /etc/resolv.conf in the container.
186
187
188 env=["PATH=/usr/local/sbin:/usr/lo‐
189 cal/bin:/usr/sbin:/usr/bin:/sbin:/bin", "TERM=xterm"]
190
191
192 Environment variable list for the container process, used for passing
193 environment variables to the container.
194
195
196 env_host=false
197
198
199 Pass all host environment variables into the container.
200
201
202 http_proxy=true
203
204
205 Default proxy environment variables will be passed into the container.
206 The environment variables passed in include: http_proxy, https_proxy,
207 ftp_proxy, no_proxy, and the upper case versions of these. The no_proxy
208 option is needed when host system uses a proxy but container should not
209 use proxy. Proxy environment variables specified for the container in
210 any other way will override the values passed from the host.
211
212
213 init=false
214
215
216 Run an init inside the container that forwards signals and reaps pro‐
217 cesses.
218
219
220 init_path="/usr/libexec/podman/catatonit"
221
222
223 Path to the container-init binary, which forwards signals and reaps
224 processes within containers. Note that the container-init binary will
225 only be used when the --init for podman-create and podman-run is set.
226
227
228 ipcns="private"
229
230
231 Default way to to create a IPC namespace for the container. Options
232 are:
233 private Create private IPC Namespace for the container.
234 host Share host IPC Namespace with the container.
235
236
237 keyring=true
238
239
240 Indicates whether the container engines create a kernel keyring for use
241 within the container.
242
243
244 label=true
245
246
247 Indicates whether the container engine uses MAC(SELinux) container sep‐
248 aration via labeling. This option is ignored on disabled systems.
249
250
251 log_driver="k8s-file"
252
253
254 Logging driver for the container. Available options: k8s-file and jour‐
255 nald.
256
257
258 log_size_max=-1
259
260
261 Maximum size allowed for the container's log file. Negative numbers in‐
262 dicate that no size limit is imposed. If it is positive, it must be >=
263 8192 to match/exceed conmon's read buffer. The file is truncated and
264 re-opened so the limit is never exceeded.
265
266
267 log_tag=""
268
269
270 Default format tag for container log messages. This is useful for cre‐
271 ating a specific tag for container log messages. Container log messages
272 default to using the truncated container ID as a tag.
273
274
275 netns="private"
276
277
278 Default way to to create a NET namespace for the container. Options
279 are:
280 private Create private NET Namespace for the container.
281 host Share host NET Namespace with the container.
282 none Containers do not use the network.
283
284
285 no_hosts=false
286
287
288 Create /etc/hosts for the container. By default, container engines
289 manage /etc/hosts, automatically adding the container's own IP ad‐
290 dress.
291
292
293 pidns="private"
294
295
296 Default way to to create a PID namespace for the container. Options
297 are:
298 private Create private PID Namespace for the container.
299 host Share host PID Namespace with the container.
300
301
302 pids_limit=1024
303
304
305 Maximum number of processes allowed in a container. 0 indicates that no
306 limit is imposed.
307
308
309 prepare_volume_on_create=false
310
311
312 Copy the content from the underlying image into the newly created vol‐
313 ume when the container is created instead of when it is started. If
314 false, the container engine will not copy the content until the con‐
315 tainer is started. Setting it to true may have negative performance im‐
316 plications.
317
318
319 rootless_networking="slirp4netns"
320
321
322 Set type of networking rootless containers should use. Valid options
323 are slirp4netns or cni.
324
325
326 seccomp_profile="/usr/share/containers/seccomp.json"
327
328
329 Path to the seccomp.json profile which is used as the default seccomp
330 profile for the runtime.
331
332
333 shm_size="65536k"
334
335
336 Size of /dev/shm. The format is <number><unit>. number must be greater
337 than 0. Unit is optional and can be: b (bytes), k (kilobytes),
338 m(megabytes), or g (gigabytes). If you omit the unit, the system uses
339 bytes. If you omit the size entirely, the system uses 65536k.
340
341
342 tz=""
343
344
345 Set timezone in container. Takes IANA timezones as well as local, which
346 sets the timezone in the container to match the host machine. If not
347 set, then containers will run with the time zone specified in the im‐
348 age.
349
350
351 Examples:
352 tz="local"
353 tz="America/New_York"
354
355
356 umask="0022"
357
358
359 Sets umask inside the container.
360
361
362 userns="host"
363
364
365 Default way to to create a USER namespace for the container. Options
366 are:
367 private Create private USER Namespace for the container.
368 host Share host USER Namespace with the container.
369
370
371 userns_size=65536
372
373
374 Number of UIDs to allocate for the automatic container creation. UIDs
375 are allocated from the “container” UIDs listed in /etc/subuid &
376 /etc/subgid.
377
378
379 utsns="private"
380
381
382 Default way to to create a UTS namespace for the container. Options
383 are:
384 private Create private UTS Namespace for the container.
385 host Share host UTS Namespace with the container.
386
387
389 The network table contains settings pertaining to the management of CNI
390 plugins.
391
392
393 cni_plugin_dirs=[]
394
395
396 List of paths to directories where CNI plugin binaries are located.
397
398
399 The default list is:
400
401
402 cni_plugin_dirs = [
403 "/usr/local/libexec/cni",
404 "/usr/libexec/cni",
405 "/usr/local/lib/cni",
406 "/usr/lib/cni",
407 "/opt/cni/bin",
408 ]
409
410
411
412 default_network="podman"
413
414
415 The network name of the default CNI network to attach pods to.
416
417
418 default_subnet="10.88.0.0/16"
419
420
421 The subnet to use for the default CNI network (named above in de‐
422 fault_network). If the default network does not exist, it will be au‐
423 tomatically created the first time a tool is run using this subnet.
424
425
426 network_config_dir="/etc/cni/net.d/"
427
428
429 Path to the directory where CNI configuration files are located.
430
431
432 volumes=[]
433
434
435 List of volumes. Specified as "directory-on-host:directory-in-con‐
436 tainer:options".
437
438
439 Example: "/db:/var/lib/db:ro".
440
441
443 The engine table contains configuration options used to set up con‐
444 tainer engines such as Podman and Buildah.
445
446
447 active_service=""
448
449
450 Name of destination for accessing the Podman service. See SERVICE DES‐
451 TINATION TABLE below.
452
453
454 cgroup_manager="systemd"
455
456
457 The cgroup management implementation used for the runtime. Supports
458 cgroupfs and systemd.
459
460
461 conmon_env_vars=[]
462
463
464 Environment variables to pass into Conmon.
465
466
467 conmon_path=[]
468
469
470 Paths to search for the conmon container manager binary. If the paths
471 are empty or no valid path was found, then the $PATH environment vari‐
472 able will be used as the fallback.
473
474
475 The default list is:
476
477
478 conmon_path=[
479 "/usr/libexec/podman/conmon",
480 "/usr/local/libexec/podman/conmon",
481 "/usr/local/lib/podman/conmon",
482 "/usr/bin/conmon",
483 "/usr/sbin/conmon",
484 "/usr/local/bin/conmon",
485 "/usr/local/sbin/conmon",
486 "/run/current-system/sw/bin/conmon",
487 ]
488
489
490
491 detach_keys="ctrl-p,ctrl-q"
492
493
494 Keys sequence used for detaching a container. Specify the keys se‐
495 quence used to detach a container. Format is a single character [a-Z]
496 or a comma separated sequence of ctrl-<value>, where <value> is one of:
497 a-z, @, ^, [, \, ], ^ or _
498
499
500 enable_port_reservation=true
501
502
503 Determines whether the engine will reserve ports on the host when they
504 are forwarded to containers. When enabled, when ports are forwarded to
505 containers, they are held open by conmon as long as the container is
506 running, ensuring that they cannot be reused by other programs on the
507 host. However, this can cause significant memory usage if a container
508 has many ports forwarded to it. Disabling this can save memory.
509
510
511 env=[]
512
513
514 Environment variables to be used when running the container engine
515 (e.g., Podman, Buildah). For example "http_proxy=internal.proxy.com‐
516 pany.com". Note these environment variables will not be used within
517 the container. Set the env section under [containers] table, if you
518 want to set environment variables for the container.
519
520
521 events_logger="journald"
522
523
524 Default method to use when logging events. Valid values: file, jour‐
525 nald, and none.
526
527
528 helper_binaries_dir=["/usr/libexec/podman", ...]
529
530
531 A is a list of directories which are used to search for helper bina‐
532 ries.
533
534
535 The default paths on Linux are: - /usr/local/libexec/podman - /usr/lo‐
536 cal/lib/podman - /usr/libexec/podman - /usr/lib/podman
537
538
539 The default paths on macOS are: - /usr/local/opt/podman/libexec
540 - /opt/homebrew/bin - /opt/homebrew/opt/podman/libexec - /usr/lo‐
541 cal/bin - /usr/local/libexec/podman - /usr/local/lib/podman
542 - /usr/libexec/podman - /usr/lib/podman
543
544
545 The default path on Windows is: - C:\Program Files\RedHat\Podman
546
547
548 hooks_dir=["/etc/containers/oci/hooks.d", ...]
549
550
551 Path to the OCI hooks directories for automatically executed hooks.
552
553
554 image_default_format="oci"|"v2s2"|"v2s1"
555
556
557 Manifest Type (oci, v2s2, or v2s1) to use when pulling, pushing, build‐
558 ing container images. By default images pulled and pushed match the
559 format of the source image. Building/committing defaults to OCI. Note:
560 image_build_format is deprecated.
561
562
563 image_default_transport="docker://"
564
565
566 Default transport method for pulling and pushing images.
567
568
569 image_parallel_copies=0
570
571
572 Maximum number of image layers to be copied (pulled/pushed) simultane‐
573 ously. Not setting this field will fall back to containers/image de‐
574 faults. (6)
575
576
577 infra_command="/pause"
578
579
580 Command to run the infra container.
581
582
583 infra_image="k8s.gcr.io/pause:3.4.1"
584
585
586 Infra (pause) container image name for pod infra containers. When run‐
587 ning a pod, we start a pause process in a container to hold open the
588 namespaces associated with the pod. This container does nothing other
589 then sleep, reserving the pods resources for the lifetime of the pod.
590
591
592 lock_type="shm"
593
594
595 Specify the locking mechanism to use; valid values are "shm" and
596 "file". Change the default only if you are sure of what you are doing,
597 in general "file" is useful only on platforms where cgo is not avail‐
598 able for using the faster "shm" lock type. You may need to run "podman
599 system renumber" after you change the lock type.
600
601
602 machine_enabled=false
603
604
605 Indicates if Podman is running inside a VM via Podman Machine. Podman
606 uses this value to do extra setup around networking from the container
607 inside the VM to to host.
608
609
610 multi_image_archive=false
611
612
613 Allows for creating archives (e.g., tarballs) with more than one image.
614 Some container engines, such as Podman, interpret additional arguments
615 as tags for one image and hence do not store more than one image. The
616 default behavior can be altered with this option.
617
618
619 namespace=""
620
621
622 Default engine namespace. If the engine is joined to a namespace, it
623 will see only containers and pods that were created in the same name‐
624 space, and will create new containers and pods in that namespace. The
625 default namespace is "", which corresponds to no namespace. When no
626 namespace is set, all containers and pods are visible.
627
628
629 network_cmd_path=""
630
631
632 Path to the slirp4netns binary.
633
634
635 network_cmd_options=["enable_ipv6=true",]
636
637
638 Default options to pass to the slirp4netns binary.
639
640
641 Valid options values are:
642
643
644 • allow_host_loopback=true|false: Allow the slirp4netns to reach
645 the host loopback IP (10.0.2.2, which is added to /etc/hosts
646 as host.containers.internal for your convenience). Default is
647 false.
648
649 • mtu=MTU: Specify the MTU to use for this network. (Default is
650 65520).
651
652 • cidr=CIDR: Specify ip range to use for this network. (Default
653 is 10.0.2.0/24).
654
655 • enable_ipv6=true|false: Enable IPv6. Default is false. (Re‐
656 quired for outbound_addr6).
657
658 • outbound_addr=INTERFACE: Specify the outbound interface slirp
659 should bind to (ipv4 traffic only).
660
661 • outbound_addr=IPv4: Specify the outbound ipv4 address slirp
662 should bind to.
663
664 • outbound_addr6=INTERFACE: Specify the outbound interface slirp
665 should bind to (ipv6 traffic only).
666
667 • outbound_addr6=IPv6: Specify the outbound ipv6 address slirp
668 should bind to.
669
670 • port_handler=rootlesskit: Use rootlesskit for port forwarding.
671 Default. Note: Rootlesskit changes the source IP address of
672 incoming packets to a IP address in the container network
673 namespace, usually 10.0.2.100. If your application requires
674 the real source IP address, e.g. web server logs, use the
675 slirp4netns port handler. The rootlesskit port handler is also
676 used for rootless containers when connected to user-defined
677 networks.
678
679 • port_handler=slirp4netns: Use the slirp4netns port forwarding,
680 it is slower than rootlesskit but preserves the correct source
681 IP address. This port handler cannot be used for user-defined
682 networks.
683
684
685
686 no_pivot_root=false
687
688
689 Whether to use chroot instead of pivot_root in the runtime.
690
691
692 num_locks=2048
693
694
695 Number of locks available for containers and pods. Each created con‐
696 tainer or pod consumes one lock. The default number available is 2048.
697 If this is changed, a lock renumbering must be performed, using the
698 podman system renumber command.
699
700
701 pull_policy="always"|"missing"|"never"
702
703
704 Pull image before running or creating a container. The default is miss‐
705 ing.
706
707
708 • missing: attempt to pull the latest image from the registries
709 listed in registries.conf if a local image does not exist.
710 Raise an error if the image is not in any listed registry and
711 is not present locally.
712
713 • always: pull the image from the first registry it is found in
714 as listed in registries.conf. Raise an error if not found in
715 the registries, even if the image is present locally.
716
717 • never: do not pull the image from the registry, use only the
718 local version. Raise an error if the image is not present lo‐
719 cally.
720
721
722
723 remote = false Indicates whether the application should be running in
724 remote mode. This flag modifies the --remote option on container en‐
725 gines. Setting the flag to true will default podman --remote=true for
726 access to the remote Podman service.
727
728
729 runtime=""
730
731
732 Default OCI specific runtime in runtimes that will be used by default.
733 Must refer to a member of the runtimes table. Default runtime will be
734 searched for on the system using the priority: "crun", "runc", "kata".
735
736
737 runtime_supports_json=["crun", "runc", "kata", "runsc", "krun"]
738
739
740 The list of the OCI runtimes that support --format=json.
741
742
743 runtime_supports_kvm=["kata", "krun"]
744
745
746 The list of OCI runtimes that support running containers with KVM sepa‐
747 ration.
748
749
750 runtime_supports_nocgroups=["crun", "krun"]
751
752
753 The list of OCI runtimes that support running containers without
754 CGroups.
755
756
757 image_copy_tmp_dir="/var/tmp"
758
759
760 Default location for storing temporary container image content. Can be
761 overridden with the TMPDIR environment variable. If you specify "stor‐
762 age", then the location of the container/storage tmp directory will be
763 used. If set then it is the users responsibility to cleanup storage.
764 Configure tmpfiles.d(5) to cleanup storage.
765
766
767 service_timeout=5
768
769
770 Number of seconds to wait without a connection before the podman sys‐
771 tem service times out and exits
772
773
774 static_dir="/var/lib/containers/storage/libpod"
775
776
777 Directory for persistent libpod files (database, etc). By default this
778 will be configured relative to where containers/storage stores contain‐
779 ers.
780
781
782 stop_timeout=10
783
784
785 Number of seconds to wait for container to exit before sending kill
786 signal.
787
788
789 tmp_dir="/run/libpod"
790
791
792 The path to a temporary directory to store per-boot container. Must be
793 a tmpfs (wiped after reboot).
794
795
796 volume_path="/var/lib/containers/storage/volumes"
797
798
799 Directory where named volumes will be created in using the default vol‐
800 ume driver. By default this will be configured relative to where con‐
801 tainers/storage store containers. This convention is followed by the
802 default volume driver, but may not be by other drivers.
803
804
805 chown_copied_files=true
806
807
808 Determines whether file copied into a container will have changed own‐
809 ership to the primary uid/gid of the container.
810
811
813 The service_destinations table contains configuration options used to
814 set up remote connections to the podman service for the podman API.
815
816
817 [service_destinations.{name}] URI to access the Podman service
818 uri="ssh://user@production.example.com/run/user/1001/podman/pod‐
819 man.sock"
820
821
822 Example URIs:
823
824
825 • rootless local - unix://run/user/1000/podman/podman.sock
826
827 • rootless remote - ssh://user@engineering.lab.com‐
828 pany.com/run/user/1000/podman/podman.sock
829
830 • rootfull local - unix://run/podman/podman.sock
831
832 • rootfull remote - ssh://root@10.10.1.136:22/run/podman/pod‐
833 man.sock
834
835
836
837 identity="~/.ssh/id_rsa
838
839
840 Path to file containing ssh identity key
841
842
843 [engine.volume_plugins]
844
845
846 A table of all the enabled volume plugins on the system. Volume plugins
847 can be used as the backend for Podman named volumes. Individual plugins
848 are specified below, as a map of the plugin name (what the plugin will
849 be called) to its path (filepath of the plugin's unix socket).
850
851
853 The secret table contains settings for the configuration of the secret
854 subsystem.
855
856
857 driver=file
858
859
860 Name of the secret driver to be used. Currently valid values are:
861 * file
862 * pass
863
864
865 [secrets.opts]
866
867
868 The driver specific options object.
869
870
872 The machine table contains configurations for podman machine VMs
873
874
875 cpus=1 Number of CPU's a machine is created with.
876
877
878 disk_size=10
879
880
881 The size of the disk in GB created when init-ing a podman-machine VM
882
883
884 image="testing"
885
886
887 Default image used when creating a new VM using podman machine init.
888 Options: testing, stable, next, or a custom path or download URL to an
889 image
890
891
892 memory=2048
893
894
895 Memory in MB a machine is created with.
896
897
898
900 containers.conf
901
902
903 Distributions often provide a /usr/share/containers/containers.conf
904 file to define default container configuration. Administrators can
905 override fields in this file by creating /etc/containers/contain‐
906 ers.conf to specify their own configuration. Rootless users can further
907 override fields in the config by creating a config file stored in the
908 $HOME/.config/containers/containers.conf file.
909
910
911 If the CONTAINERS_CONF path environment variable is set, just this path
912 will be used. This is primarily used for testing.
913
914
915 Fields specified in the containers.conf file override the default op‐
916 tions, as well as options in previously read containers.conf files.
917
918
919 storage.conf
920
921
922 The /etc/containers/storage.conf file is the default storage configura‐
923 tion file. Rootless users can override fields in the storage config by
924 creating $HOME/.config/containers/storage.conf.
925
926
927 If the CONTAINERS_STORAGE_CONF path environment variable is set, this
928 path is used for the storage.conf file rather than the default. This
929 is primarily used for testing.
930
931
932
934 containers-storage.conf(5), containers-policy.json(5), containers-reg‐
935 istries.conf(5), tmpfiles.d(5)
936
937
938
939engine Container containers.conf(5)