Update documentation of `--no-hosts`, `--hostname`, and `--name` CLI options

Update the docs to properly cross-reference the `--add-host` option.

Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
This commit is contained in:
Daniel Rudolf 2024-09-25 21:42:56 +02:00
parent c67d8baeb6
commit 6e4ef2c54d
No known key found for this signature in database
GPG Key ID: A061F02CD8DE4538
4 changed files with 25 additions and 10 deletions

View File

@ -4,6 +4,10 @@
####> are applicable to all of those.
#### **--hostname**, **-h**=*name*
Container host name
Set the container's hostname inside the container.
Sets the container host name that is available inside the container. Can only be used with a private UTS namespace `--uts=private` (default). If `--pod` is specified and the pod shares the UTS namespace (default) the pod's hostname is used.
This option can only be used with a private UTS namespace `--uts=private`
(default). If `--pod` is given and the pod shares the same UTS namespace
(default), the pod's hostname is used. The given hostname is also added to the
`/etc/hosts` file using the container's primary IP address (also see the
**--add-host** option).

View File

@ -4,4 +4,7 @@
####> are applicable to all of those.
#### **--hostname**=*name*
Set a hostname to the pod.
Set the pod's hostname inside all containers.
The given hostname is also added to the `/etc/hosts` file using the container's
primary IP address (also see the **--add-host** option).

View File

@ -12,7 +12,9 @@ The operator can identify a container in three ways:
- UUID short identifier (“f78375b1c487”);
- Name (“jonah”).
Podman generates a UUID for each container, and if a name is not assigned
to the container with **--name** then it generates a random
string name. The name can be useful as a more human-friendly way to identify containers.
This works for both background and foreground containers.
Podman generates a UUID for each container, and if no name is assigned to the
container using **--name**, Podman generates a random string name. The name can
be useful as a more human-friendly way to identify containers. This works for
both background and foreground containers. The container's name is also added
to the `/etc/hosts` file using the container's primary IP address (also see the
**--add-host** option).

View File

@ -4,6 +4,12 @@
####> are applicable to all of those.
#### **--no-hosts**
Do not create _/etc/hosts_ for the <<container|pod>>.
By default, Podman manages _/etc/hosts_, adding the container's own IP address and any hosts from **--add-host**.
**--no-hosts** disables this, and the image's _/etc/hosts_ is preserved unmodified.
Do not modify the `/etc/hosts` file in the <<container|pod>>.
Podman assumes control over the <<container|pod>>'s `/etc/hosts` file by
default and adds entries for the container's name (see **--name** option) and
hostname (see **--hostname** option), the internal `host.containers.internal`
and `host.docker.internal` hosts, as well as any hostname added using the
**--add-host** option. Refer to the **--add-host** option for details. Passing
**--no-hosts** disables this, so that the image's `/etc/hosts` file is kept
unmodified.