From 0c8b53e6f7a94e914a7815328bbd16c0b3943d40 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 30 Dec 2022 22:23:05 +0100 Subject: container: T578: backport podman from 1.4 development branch --- op-mode-definitions/container.xml.in | 176 +++++++++++++++++++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 op-mode-definitions/container.xml.in (limited to 'op-mode-definitions') diff --git a/op-mode-definitions/container.xml.in b/op-mode-definitions/container.xml.in new file mode 100644 index 000000000..786bd66d3 --- /dev/null +++ b/op-mode-definitions/container.xml.in @@ -0,0 +1,176 @@ + + + + + + + Add container image + + + + + Pull a new image for container + + sudo podman image pull "${4}" + + + + + + + + + + Attach to a running container + + container name + + + sudo podman exec --interactive --tty "$3" /bin/sh + + + + + + + + Delete container image + + + + + Delete container image + + + + + sudo podman image rm --force "${4}" + + + + + + + + + + Generate Container Image + + + + + Name of container image (tag) + + + + + Path to Dockerfile + + <filename> + + + sudo podman build --net host --layers --force-rm --tag "$4" $6 + + + + + + + + + + + + + + Monitor last lines of container logs + + container name + + + sudo podman logs --follow --names "$4" + + + + + + + + + + Show containers + + sudo ${vyos_op_scripts_dir}/container.py show_container + + + + Show container image + + sudo ${vyos_op_scripts_dir}/container.py show_image + + + + Show logs from a given container + + container name + + + sudo podman logs --names "$4" + + + + Show available container networks + + sudo ${vyos_op_scripts_dir}/container.py show_network + + + + + + + + Show logs from a given container + + container name + + + sudo podman logs --names "$4" + + + + + + + + + + Restart a given container + + container name + + + sudo ${vyos_op_scripts_dir}/container.py restart --name="$3" + + + + + + + + Update a container image + + + + + Update container image + + container name + + + if cli-shell-api existsActive container name "$4"; then sudo podman pull $(cli-shell-api returnActiveValue container name "$4" image); else echo "Container $4 does not exist"; fi + + + + + + -- cgit v1.2.3