Merge pull request #21729 from rhatdan/docs4

[CI:DOCS] Fix up example description of podman-network commands
This commit is contained in:
openshift-merge-bot[bot]
2024-02-19 13:23:36 +00:00
committed by GitHub
8 changed files with 19 additions and 25 deletions

View File

@ -28,17 +28,17 @@ Set a static mac address for this container on this network.
## EXAMPLE ## EXAMPLE
Connect a container named *web* to a network named *test* Connect specified container to a named network:
``` ```
podman network connect test web podman network connect test web
``` ```
Connect a container name *web* to a network named *test* with two aliases: web1 and web2 Connect specified container to named network with two aliases:
``` ```
podman network connect --alias web1 --alias web2 test web podman network connect --alias web1 --alias web2 test web
``` ```
Connect a container name *web* to a network named *test* with a static ip. Connect specified container to named network with a static ip:
``` ```
podman network connect --ip 10.89.1.13 test web podman network connect --ip 10.89.1.13 test web
``` ```

View File

@ -18,8 +18,8 @@ and it does not have network connectivity until a network is connected again.
Force the container to disconnect from a network Force the container to disconnect from a network
## EXAMPLE ## EXAMPLE
Disconnect a container named *web* from a network called *test*.
Disconnect container from specified network:
``` ```
podman network disconnect test web podman network disconnect test web
``` ```

View File

@ -21,20 +21,18 @@ Print usage statement
## EXAMPLE ## EXAMPLE
Check if a network called `net1` exists (the network does actually exist). Check if specified network exists (the network does actually exist):
``` ```
$ podman network exists net1 $ podman network exists net1
$ echo $? $ echo $?
0 0
$
``` ```
Check if a network called `webbackend` exists (the network does not actually exist). Check if nonexistent network exists:
``` ```
$ podman network exists webbackend $ podman network exists webbackend
$ echo $? $ echo $?
1 1
$
``` ```
## SEE ALSO ## SEE ALSO

View File

@ -71,8 +71,7 @@ The `quiet` option restricts the output to only the network names.
## EXAMPLE ## EXAMPLE
Display networks Display networks:
``` ```
$ podman network ls $ podman network ls
NETWORK ID NAME DRIVER NETWORK ID NAME DRIVER
@ -81,7 +80,7 @@ NETWORK ID NAME DRIVER
8e35c2cd3bf6 podman5 macvlan 8e35c2cd3bf6 podman5 macvlan
``` ```
Display only network names Display only network names:
``` ```
$ podman network ls -q $ podman network ls -q
podman podman
@ -90,14 +89,14 @@ outside
podman9 podman9
``` ```
Display name of network which support bridge plugin Display name of network which support bridge plugin:
``` ```
$ podman network ls --filter driver=bridge --format {{.Name}} $ podman network ls --filter driver=bridge --format {{.Name}}
podman podman
podman2 podman2
podman9 podman9
``` ```
List networks with their subnets List networks with their subnets:
``` ```
$ podman network ls --format "{{.Name}}: {{range .Subnets}}{{.Subnet}} {{end}}" $ podman network ls --format "{{.Name}}: {{range .Subnets}}{{.Subnet}} {{end}}"
podman: 10.88.0.0/16 podman: 10.88.0.0/16

View File

@ -35,12 +35,13 @@ The `until` *filter* can be Unix timestamps, date formatted timestamps, or Go du
Do not prompt for confirmation Do not prompt for confirmation
## EXAMPLE ## EXAMPLE
Prune networks
Prune networks:
``` ```
podman network prune podman network prune
``` ```
Prune all networks created before 2h Prune all networks created not created in the last two hours:
``` ```
podman network prune --filter until=2h podman network prune --filter until=2h
``` ```

View File

@ -22,8 +22,7 @@ Reload network configuration of all containers.
## EXAMPLE ## EXAMPLE
Reload the network configuration after a firewall reload. Reload the network configuration after a firewall reload:
``` ```
# podman run -p 80:80 -d nginx # podman run -p 80:80 -d nginx
b1b538e8bc4078fc3ee1c95b666ebc7449b9a97bacd15bcbe464a29e1be59c1c b1b538e8bc4078fc3ee1c95b666ebc7449b9a97bacd15bcbe464a29e1be59c1c
@ -39,8 +38,7 @@ b1b538e8bc4078fc3ee1c95b666ebc7449b9a97bacd15bcbe464a29e1be59c1c
works works
``` ```
Reload the network configuration for all containers. Reload the network configuration for all containers:
``` ```
# podman network reload --all # podman network reload --all
b1b538e8bc4078fc3ee1c95b666ebc7449b9a97bacd15bcbe464a29e1be59c1c b1b538e8bc4078fc3ee1c95b666ebc7449b9a97bacd15bcbe464a29e1be59c1c

View File

@ -21,15 +21,13 @@ Seconds to wait before forcibly stopping the running containers that are using t
## EXAMPLE ## EXAMPLE
Delete the `podman9` network Delete specified network:
``` ```
# podman network rm podman9 # podman network rm podman9
Deleted: podman9 Deleted: podman9
``` ```
Delete the `fred` network and all containers associated with the network. Delete specified network and all containers associated with the network:
``` ```
# podman network rm -f fred # podman network rm -f fred
Deleted: fred Deleted: fred

View File

@ -23,12 +23,12 @@ Accepts array of DNS resolvers and removes them from the existing list of resolv
## EXAMPLE ## EXAMPLE
Update a network Update a network:
``` ```
$ podman network update network1 --dns-add 8.8.8.8,1.1.1.1 $ podman network update network1 --dns-add 8.8.8.8,1.1.1.1
``` ```
Update a network and add/remove dns servers Update a network and add/remove dns servers:
``` ```
$ podman network update network1 --dns-drop 8.8.8.8 --dns-add 3.3.3.3 $ podman network update network1 --dns-drop 8.8.8.8 --dns-add 3.3.3.3
``` ```