diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-05-07 18:37:32 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-05-17 20:46:45 +0200 |
commit | 3a9530e5f19565a9cadb7f20bd987c61e0e7c377 (patch) | |
tree | f0ecc881eb1ed00d3a57ec7ce472c356e514c6cc /man | |
parent | 5a4ff98840fba01f9eb1bed23846ae8d1ca796b5 (diff) | |
download | systemd-3a9530e5f19565a9cadb7f20bd987c61e0e7c377.tar.gz systemd-3a9530e5f19565a9cadb7f20bd987c61e0e7c377.tar.bz2 systemd-3a9530e5f19565a9cadb7f20bd987c61e0e7c377.zip |
nspawn: make the hostname of the container explicitly configurable with a new --hostname= switch
Previously, the container's hostname was exclusively initialized from
the machine name configured with --machine=, i.e. the internal name and
the external name used for and by the container was synchronized. This
adds a new option --hostname= that optionally allows the internal name
to deviate from the external name.
This new option is mainly useful to ultimately implement the OCI runtime
spec directly in nspawn, but it might be useful on its own for some
other usecases too.
Diffstat (limited to 'man')
-rw-r--r-- | man/systemd-nspawn.xml | 16 | ||||
-rw-r--r-- | man/systemd.nspawn.xml | 9 |
2 files changed, 25 insertions, 0 deletions
diff --git a/man/systemd-nspawn.xml b/man/systemd-nspawn.xml index c6b027c58f..16d65d2b29 100644 --- a/man/systemd-nspawn.xml +++ b/man/systemd-nspawn.xml @@ -374,6 +374,22 @@ </varlistentry> <varlistentry> + <term><option>--hostname=</option></term> + + <listitem><para>Controls the hostname to set within the container, if different from the machine name. Expects + a valid hostname as argument. If this option is used, the kernel hostname of the container will be set to this + value, otherwise it will be initialized to the machine name as controlled by the <option>--machine=</option> + option described above. The machine name is used for various aspect of identification of the container from the + outside, the kernel hostname configurable with this option is useful for the container to identify itself from + the inside. It is usually a good idea to keep both forms of identification synchronized, in order to avoid + confusion. It is hence recommended to avoid usage of this option, and use <option>--machine=</option> + exclusively. Note that regardless whether the container's hostname is initialized from the name set with + <option>--hostname=</option> or the one set with <option>--machine=</option>, the container can later override + its kernel hostname freely on its own as well.</para> + </listitem> + </varlistentry> + + <varlistentry> <term><option>--uuid=</option></term> <listitem><para>Set the specified UUID for the container. The diff --git a/man/systemd.nspawn.xml b/man/systemd.nspawn.xml index 6bd7b33b34..3f8c325fd9 100644 --- a/man/systemd.nspawn.xml +++ b/man/systemd.nspawn.xml @@ -302,6 +302,15 @@ details.</para></listitem> </varlistentry> + <varlistentry> + <term><varname>Hostname=</varname></term> + + <listitem><para>Configures the kernel hostname set for the container. This is equivalent to the + <option>--hostname=</option> command line switch, and takes the same argument. See + <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> for + details.</para></listitem> + </varlistentry> + </variablelist> </refsect1> |