confd: add support for publishing container ports

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2024-02-25 19:49:27 +01:00
parent b04c81199d
commit 3d85eba3fc
3 changed files with 17 additions and 3 deletions
+3
View File
@@ -52,6 +52,9 @@ static int add(const char *name, struct lyd_node *cif)
LYX_LIST_FOR_EACH(lyd_child(cif), node, "search")
fprintf(fp, " --dns-search %s", lyd_get_value(node));
LYX_LIST_FOR_EACH(lyd_child(cif), node, "publish")
fprintf(fp, " -p %s", lyd_get_value(node));
fprintf(fp, " create %s %s", name, image);
LYX_LIST_FOR_EACH(lyd_child(cif), node, "network") {
@@ -116,7 +116,11 @@ module infix-containers {
}
leaf-list publish {
description "Publish container port, or a range of ports, to the host.";
description "Publish container port, or a range of ports, to the host.
Syntax: [[ip:][hostPort]:]containerPort[/protocol]
Sample: 8080:80 -- forward tcp port 8080 to container port 80
69:69/udp -- forward udp port 69 to container port 69
127.0.0.1:8080:80 -- forward only from loopback interface";
type string;
}