Defining a container in VyOS (seemingly with any set of attributes/images/etc, these are the defaults)
# show container name test { - disable image hello-world network test { } } network test { prefix 169.254.3.0/28 }
produces:
ExecStart=/usr/bin/podman run \ --conmon-pidfile %t/%n.pid --cidfile %t/%n.cid --cgroups=no-conmon \ --detach --interactive --tty --replace --memory 512m --shm-size 64m --memory-swap 0 --restart on-failure --name
in the system service which then cannot start due to
Apr 11 19:50:37 hostname conmon[678861]: conmon fc5ac8e7b18a9113e265 <nwarn>: Failed to get console terminal settings Apr 11 19:50:37 hostname conmon[678861]: conmon fc5ac8e7b18a9113e265 <nwarn>: runtime stderr: cannot set memory+swap limit less than the memory limit Apr 11 19:50:37 hostname conmon[678861]: conmon fc5ac8e7b18a9113e265 <error>: Failed to create container: exit status 1 Apr 11 19:50:37 hostname podman[678832]: Error: OCI runtime error: crun: cannot set memory+swap limit less than the memory limit
Getting a container to actually start requires:
- Setting the container to disabled in the config
- Editing the systemd service definition to remove the --memory-swap piece
- Starting the systemd container service from the shell (as enabling in the config will regenerate the weird memory settings)
Suggest simplifying the config generator:
- avoid setting default values for memory-related parameters unless the user specifies them explicitly
- not rendering those arguments in the systemd service template when they are not set by the user