|
346 | 346 | in the container's file system namespace.</para> |
347 | 347 |
|
348 | 348 | <para>This is for containers which have several bootable directories in them; for example, several |
349 | | - <ulink url="https://ostree.readthedocs.io/en/latest/">OSTree</ulink> deployments. It emulates the behavior of the boot |
350 | | - loader and initial RAM disk which normally select which directory to mount as root and start the container's PID 1 in.</para></listitem> |
| 349 | + <ulink url="https://ostree.readthedocs.io/en/latest/">OSTree</ulink> deployments. It emulates the behavior of |
| 350 | + the boot loader and initial RAM disk which normally select which directory to mount as the root and start the |
| 351 | + container's PID 1 in.</para></listitem> |
351 | 352 | </varlistentry> |
352 | 353 |
|
353 | 354 | <varlistentry> |
|
1041 | 1042 | <example> |
1042 | 1043 | <title>Download a Fedora image and start a shell in it</title> |
1043 | 1044 |
|
1044 | | - <programlisting># machinectl pull-raw --verify=no http://ftp.halifax.rwth-aachen.de/fedora/linux/releases/24/CloudImages/x86_64/images/Fedora-Cloud-Base-24-1.2.x86_64.raw.xz |
1045 | | -# systemd-nspawn -M Fedora-Cloud-Base-24-1.2.x86_64.raw</programlisting> |
| 1045 | + <programlisting># machinectl pull-raw --verify=no \ |
| 1046 | + https://download.fedoraproject.org/pub/fedora/linux/releases/25/CloudImages/x86_64/images/Fedora-Cloud-Base-25-1.3.x86_64.raw.xz |
| 1047 | +# systemd-nspawn -M Fedora-Cloud-Base-25-1.3.x86_64.raw</programlisting> |
1046 | 1048 |
|
1047 | 1049 | <para>This downloads an image using |
1048 | 1050 | <citerefentry><refentrytitle>machinectl</refentrytitle><manvolnum>1</manvolnum></citerefentry> |
|
1052 | 1054 | <example> |
1053 | 1055 | <title>Build and boot a minimal Fedora distribution in a container</title> |
1054 | 1056 |
|
1055 | | - <programlisting># dnf -y --releasever=23 --installroot=/srv/mycontainer --disablerepo='*' --enablerepo=fedora --enablerepo=updates install systemd passwd dnf fedora-release vim-minimal |
| 1057 | + <programlisting># dnf -y --releasever=25 --installroot=/srv/mycontainer \ |
| 1058 | + --disablerepo='*' --enablerepo=fedora --enablerepo=updates install \ |
| 1059 | + systemd passwd dnf fedora-release vim-minimal |
1056 | 1060 | # systemd-nspawn -bD /srv/mycontainer</programlisting> |
1057 | 1061 |
|
1058 | 1062 | <para>This installs a minimal Fedora distribution into the |
|
1095 | 1099 | <title>Run a container with SELinux sandbox security contexts</title> |
1096 | 1100 |
|
1097 | 1101 | <programlisting># chcon system_u:object_r:svirt_sandbox_file_t:s0:c0,c1 -R /srv/container |
1098 | | -# systemd-nspawn -L system_u:object_r:svirt_sandbox_file_t:s0:c0,c1 -Z system_u:system_r:svirt_lxc_net_t:s0:c0,c1 -D /srv/container /bin/sh</programlisting> |
| 1102 | +# systemd-nspawn -L system_u:object_r:svirt_sandbox_file_t:s0:c0,c1 \ |
| 1103 | + -Z system_u:system_r:svirt_lxc_net_t:s0:c0,c1 -D /srv/container /bin/sh</programlisting> |
1099 | 1104 | </example> |
1100 | 1105 |
|
1101 | 1106 | <example> |
1102 | 1107 | <title>Run a container with an OSTree deployment</title> |
1103 | 1108 |
|
1104 | | - <programlisting># systemd-nspawn -b -i ~/image.raw --pivot-root=/ostree/deploy/$OS/deploy/$CHECKSUM:/sysroot --bind=+/sysroot/ostree/deploy/$OS/var:/var</programlisting> |
| 1109 | + <programlisting># systemd-nspawn -b -i ~/image.raw \ |
| 1110 | + --pivot-root=/ostree/deploy/$OS/deploy/$CHECKSUM:/sysroot \ |
| 1111 | + --bind=+/sysroot/ostree/deploy/$OS/var:/var</programlisting> |
1105 | 1112 | </example> |
1106 | 1113 | </refsect1> |
1107 | 1114 |
|
|
0 commit comments