]>
Commit | Line | Data |
---|---|---|
fb261f53 KY |
1 | <!-- |
2 | ||
3 | lxc: linux Container library | |
4 | ||
5 | (C) Copyright IBM Corp. 2007, 2008 | |
6 | ||
7 | Authors: | |
8 | Daniel Lezcano <daniel.lezcano at free.fr> | |
9 | ||
10 | This library is free software; you can redistribute it and/or | |
11 | modify it under the terms of the GNU Lesser General Public | |
12 | License as published by the Free Software Foundation; either | |
13 | version 2.1 of the License, or (at your option) any later version. | |
14 | ||
15 | This library is distributed in the hope that it will be useful, | |
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
18 | Lesser General Public License for more details. | |
19 | ||
20 | You should have received a copy of the GNU Lesser General Public | |
21 | License along with this library; if not, write to the Free Software | |
22 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
23 | ||
24 | Translated into Japanese | |
25 | by KATOH Yasufumi <karma at jazz.email.ne.jp> | |
26 | ||
27 | --> | |
28 | ||
29 | <!DOCTYPE refentry PUBLIC @docdtd@ [ | |
30 | ||
31 | <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml"> | |
32 | ]> | |
33 | ||
34 | <refentry> | |
35 | ||
36 | <docinfo><date>@LXC_GENERATE_DATE@</date></docinfo> | |
37 | ||
38 | <refmeta> | |
39 | <refentrytitle>lxc.container.conf</refentrytitle> | |
40 | <manvolnum>5</manvolnum> | |
41 | </refmeta> | |
42 | ||
43 | <refnamediv> | |
44 | <refname>lxc.container.conf</refname> | |
45 | ||
46 | <refpurpose> | |
47 | <!-- | |
48 | LXC container configuration file | |
49 | --> | |
50 | LXC コンテナ設定ファイル | |
51 | </refpurpose> | |
52 | </refnamediv> | |
53 | ||
54 | <refsect1> | |
55 | <title><!-- Description -->説明</title> | |
56 | ||
57 | <para> | |
58 | <!-- | |
2513f519 KY |
59 | LXC is the well-known and heavily tested low-level Linux container |
60 | runtime. It is in active development since 2008 and has proven itself in | |
61 | critical production environments world-wide. Some of its core contributors | |
62 | are the same people that helped to implement various well-known | |
63 | containerization features inside the Linux kernel. | |
64 | --> | |
65 | LXC は良く知られた、多くのテストが行われた Linux コンテナのランタイムです。LXC は、2008 年以来アクティブに開発されており、世界中の重要な本番環境で実証されています。開発への貢献者の中には、Linux カーネル内の良く知られた様々なコンテナ機能の実装に貢献した人と同じ人もいます。 | |
fb261f53 KY |
66 | </para> |
67 | ||
68 | <para> | |
69 | <!-- | |
2513f519 KY |
70 | LXC's main focus is system containers. That is, containers which offer an |
71 | environment as close as possible as the one you'd get from a VM but | |
72 | without the overhead that comes with running a separate kernel and | |
73 | simulating all the hardware. | |
74 | --> | |
75 | LXC は主にシステムコンテナにフォーカスを当てています。つまり、VM で得られる環境と可能な限り近い環境を提供を提供するにも関わらず、別々のカーネルを実行したり、ハードウェアをすべてシミュレートしたりすることによるオーバーヘッドがないコンテナのことです。 | |
76 | </para> | |
77 | ||
78 | <para> | |
79 | <!-- | |
80 | This is achieved through a combination of kernel security features such as | |
81 | namespaces, mandatory access control and control groups. | |
82 | --> | |
83 | このような環境は、名前空間 (namespace)、強制アクセスコントロール、cgroup といったカーネルのセキュリティ機能の組み合わせで実現しています。 | |
84 | </para> | |
85 | ||
86 | <para> | |
87 | <!-- | |
88 | LXC has supports unprivileged containers. Unprivileged containers are | |
89 | containers that are run without any privilege. This requires support for | |
90 | user namespaces in the kernel that the container is run on. LXC was the | |
91 | first runtime to support unprivileged containers after user namespaces | |
92 | were merged into the mainline kernel. | |
93 | --> | |
94 | LXC は非特権コンテナをサポートしています。非特権コンテナは、いかなる特権も持たずに実行するコンテナです。非特権コンテナの実行には、コンテナを実行しているカーネルにユーザ名前空間 (user namespace) のサポートが必要です。LXC は、ユーザ名前空間がメインラインカーネルにマージされてから、初めて非特権コンテナをサポートしたランタイムです。 | |
95 | </para> | |
96 | ||
97 | <para> | |
98 | <!-- | |
99 | In essence, user namespaces isolate given sets of UIDs and GIDs. This is | |
100 | achieved by establishing a mapping between a range of UIDs and GIDs on the | |
101 | host to a different (unprivileged) range of UIDs and GIDs in the | |
102 | container. The kernel will translate this mapping in such a way that | |
103 | inside the container all UIDs and GIDs appear as you would expect from the | |
104 | host whereas on the host these UIDs and GIDs are in fact unprivileged. For | |
105 | example, a process running as UID and GID 0 inside the container might | |
106 | appear as UID and GID 100000 on the host. The implementation and working | |
107 | details can be gathered from the corresponding user namespace man page. | |
bdcbb6b3 | 108 | UID and GID mappings can be defined with the <option>lxc.idmap</option> |
2513f519 KY |
109 | key. |
110 | --> | |
111 | 本質的には、ユーザ名前空間は与えられた UID、GID の組を隔離します。ユーザ名前空間は、ホスト上の UID、GID のある範囲を、それとは異なるコンテナ上の UID、GID の範囲へマッピングすることで実現します。カーネルは、ホスト上では実際には UID、GID は特権を持たないにも関わらず、コンテナ内ではすべての UID、GID が期待されるように見えるように変換を行います。 | |
bdcbb6b3 | 112 | 例えば、コンテナ内では UID、GID が 0 として実行中のプロセスは、ホスト上では UID、GID が 100000 として見えるでしょう。実装と動作の詳細は、ユーザ名前空間の man ページから得られます。UID と GID のマッピングは <option>lxc.idmap</option> を使って定義できます。 |
fb261f53 KY |
113 | </para> |
114 | ||
115 | <para> | |
116 | <!-- | |
2513f519 KY |
117 | Linux containers are defined with a simple configuration file. Each |
118 | option in the configuration file has the form <command>key = | |
119 | value</command> fitting in one line. The "#" character means the line is a | |
120 | comment. List options, like capabilities and cgroups options, can be used | |
121 | with no value to clear any previously defined values of that option. | |
122 | --> | |
123 | Linux コンテナは、簡単な設定ファイルで定義します。設定ファイル中のオプションは <command>key = value</command> の形で一行で表します。'#' は、その行はコメントであることを示します。ケーパビリティや cgroup のオプションのような、リスト形式で指定するオプションでは、value がない形式で指定でき、そのように使うと、それ以前に定義した値をすべてクリアします。 | |
124 | </para> | |
125 | ||
126 | <para> | |
127 | <!-- | |
128 | LXC namespaces configuration keys by using single dots. This means complex | |
7fa3f2e9 | 129 | configuration keys such as <option>lxc.net.0</option> expose various |
130 | subkeys such as <option>lxc.net.0.type</option>, | |
e71b47b2 | 131 | <option>lxc.net.0.link</option>, <option>lxc.net.0.ipv6.address</option>, and |
2513f519 | 132 | others for even more fine-grained configuration. |
fb261f53 | 133 | --> |
e71b47b2 | 134 | LXC は、シングルドットを使って設定キーの名前空間を表します。<option>lxc.net.0</option> のような複雑な設定キーは、<option>lxc.net.0.type</option>、<option>lxc.net.0.link</option>、<option>lxc.net.0.ipv6.address</option> や、さらに細分化された設定向けの色々なサブキーを持つことを意味します。 |
fb261f53 KY |
135 | </para> |
136 | ||
137 | <refsect2> | |
138 | <title><!-- Configuration -->設定</title> | |
139 | <para> | |
140 | <!-- | |
2513f519 KY |
141 | In order to ease administration of multiple related containers, it is |
142 | possible to have a container configuration file cause another file to be | |
143 | loaded. For instance, network configuration can be defined in one common | |
144 | file which is included by multiple containers. Then, if the containers | |
145 | are moved to another host, only one file may need to be updated. | |
146 | --> | |
dc421f3a KY |
147 | 複数の関係するコンテナの管理を容易にするために、コンテナの設定ファイルに別のファイルをロードすることが可能です。 |
148 | 例えば、ネットワークの設定を、複数のコンテナから include させるように 1 つのファイルに定義することが可能です。 | |
149 | その場合、コンテナが他のホストに移動すると、そのファイルだけを更新する必要があるかもしれません。 | |
fb261f53 KY |
150 | </para> |
151 | ||
152 | <variablelist> | |
50a8555e KY |
153 | <varlistentry> |
154 | <term> | |
155 | <option>lxc.include</option> | |
156 | </term> | |
157 | <listitem> | |
158 | <para> | |
fb261f53 | 159 | <!-- |
50a8555e KY |
160 | Specify the file to be included. The included file must be |
161 | in the same valid lxc configuration file format. | |
fb261f53 | 162 | --> |
dc421f3a KY |
163 | include させたいファイルを指定します。 |
164 | include するファイルは、lxc 設定ファイルのフォーマットとして有効でなければいけません。 | |
50a8555e KY |
165 | </para> |
166 | </listitem> | |
167 | </varlistentry> | |
fb261f53 KY |
168 | </variablelist> |
169 | </refsect2> | |
170 | ||
171 | <refsect2> | |
172 | <title><!-- Architecture -->アーキテクチャ</title> | |
173 | <para> | |
174 | <!-- | |
2513f519 KY |
175 | Allows one to set the architecture for the container. For example, set a |
176 | 32bits architecture for a container running 32bits binaries on a 64bits | |
177 | host. This fixes the container scripts which rely on the architecture to | |
178 | do some work like downloading the packages. | |
fb261f53 | 179 | --> |
dc421f3a KY |
180 | コンテナに対してアーキテクチャを設定することが可能です。 |
181 | 例えば、64 ビットのホスト上で 32 ビットのバイナリを動かすために 32 ビットアーキテクチャを設定することが可能です。 | |
182 | この設定を行うことにより、パッケージのダウンロードを行うなどの作業のうち、アーキテクチャ名に依存するような作業を行うコンテナスクリプトの修正を行います。 | |
fb261f53 KY |
183 | </para> |
184 | ||
185 | <variablelist> | |
50a8555e KY |
186 | <varlistentry> |
187 | <term> | |
188 | <option>lxc.arch</option> | |
189 | </term> | |
190 | <listitem> | |
191 | <para> | |
fb261f53 | 192 | <!-- |
50a8555e | 193 | Specify the architecture for the container. |
fb261f53 | 194 | --> |
dc421f3a | 195 | コンテナに設定するアーキテクチャを指定します。 |
50a8555e KY |
196 | </para> |
197 | <para> | |
fb261f53 | 198 | <!-- |
2513f519 KY |
199 | Some valid options are |
200 | <option>x86</option>, | |
201 | <option>i686</option>, | |
202 | <option>x86_64</option>, | |
203 | <option>amd64</option> | |
204 | --> | |
205 | 有効なオプションには以下のようなものがあります。 | |
206 | <option>x86</option>, | |
207 | <option>i686</option>, | |
208 | <option>x86_64</option>, | |
209 | <option>amd64</option> | |
210 | </para> | |
211 | </listitem> | |
212 | </varlistentry> | |
fb261f53 KY |
213 | </variablelist> |
214 | ||
215 | </refsect2> | |
216 | ||
217 | <refsect2> | |
218 | <title><!-- Hostname -->ホスト名</title> | |
219 | <para> | |
220 | <!-- | |
2513f519 KY |
221 | The utsname section defines the hostname to be set for the container. |
222 | That means the container can set its own hostname without changing the | |
223 | one from the system. That makes the hostname private for the container. | |
fb261f53 | 224 | --> |
dc421f3a KY |
225 | utsname セクションは、コンテナに設定されるホスト名を定義します。 |
226 | コンテナは、システムのホスト名を変えることなく、自身のホスト名を持つ事が可能です。 | |
227 | このことにより、ホスト名はコンテナ専用となります。 | |
fb261f53 KY |
228 | </para> |
229 | <variablelist> | |
50a8555e KY |
230 | <varlistentry> |
231 | <term> | |
b67771bc | 232 | <option>lxc.uts.name</option> |
50a8555e KY |
233 | </term> |
234 | <listitem> | |
235 | <para> | |
fb261f53 | 236 | <!-- |
50a8555e | 237 | specify the hostname for the container |
fb261f53 | 238 | --> |
dc421f3a | 239 | コンテナのホスト名を指定します。 |
50a8555e KY |
240 | </para> |
241 | </listitem> | |
242 | </varlistentry> | |
fb261f53 KY |
243 | </variablelist> |
244 | </refsect2> | |
245 | ||
246 | <refsect2> | |
247 | <title><!-- Halt signal -->クリーンなシャットダウン時のシグナル</title> | |
248 | <para> | |
50a8555e | 249 | <!-- |
2513f519 KY |
250 | Allows one to specify signal name or number sent to the container's |
251 | init process to cleanly shutdown the container. Different init systems | |
252 | could use different signals to perform clean shutdown sequence. This | |
253 | option allows the signal to be specified in kill(1) fashion, e.g. | |
254 | SIGPWR, SIGRTMIN+14, SIGRTMAX-10 or plain number. The default signal is | |
255 | SIGPWR. | |
50a8555e | 256 | --> |
2513f519 | 257 | コンテナをクリーンにシャットダウンするためにコンテナの init プロセスに送るシグナル名か番号を指定できます。init システムによって、クリーンなシャットダウンを行うために使うシグナルは異なります。このオプションではシグナルとして kill(1) で使う形式を指定できます。 |
dc421f3a | 258 | 例えば SIGKILL, SIGRTMIN+14, SIGRTMAX-10 のような形式、もしくは数字を指定します。デフォルトのシグナルは SIGPWR です。 |
fb261f53 KY |
259 | </para> |
260 | <variablelist> | |
ea4cadbf KY |
261 | <varlistentry> |
262 | <term> | |
55c84efc | 263 | <option>lxc.signal.halt</option> |
ea4cadbf KY |
264 | </term> |
265 | <listitem> | |
266 | <para> | |
267 | <!-- | |
268 | specify the signal used to halt the container | |
269 | --> | |
270 | コンテナをシャットダウンするために使うシグナルを指定します。 | |
271 | </para> | |
272 | </listitem> | |
273 | </varlistentry> | |
274 | </variablelist> | |
275 | </refsect2> | |
276 | ||
277 | <refsect2> | |
278 | <title>リブート時のシグナル <!-- Reboot signal --></title> | |
279 | <para> | |
280 | <!-- | |
2513f519 KY |
281 | Allows one to specify signal name or number to reboot the container. |
282 | This option allows signal to be specified in kill(1) fashion, e.g. | |
283 | SIGTERM, SIGRTMIN+14, SIGRTMAX-10 or plain number. The default signal | |
284 | is SIGINT. | |
fb261f53 | 285 | --> |
2513f519 | 286 | コンテナをリブートするために送るシグナル名か番号を指定できます。このオプションではシグナルとして kill(1) で使う形式を指定できます。 |
ea4cadbf KY |
287 | 例えば SIGKILL, SIGRTMIN+14, SIGRTMAX-10 のような形式、もしくは数字を指定します。デフォルトのシグナルは SIGINT です。 |
288 | </para> | |
289 | <variablelist> | |
290 | <varlistentry> | |
291 | <term> | |
55c84efc | 292 | <option>lxc.signal.reboot</option> |
ea4cadbf KY |
293 | </term> |
294 | <listitem> | |
295 | <para> | |
296 | <!-- | |
297 | specify the signal used to reboot the container | |
298 | --> | |
299 | コンテナをリブートするために使うシグナルを指定します。 | |
300 | </para> | |
301 | </listitem> | |
302 | </varlistentry> | |
fb261f53 KY |
303 | </variablelist> |
304 | </refsect2> | |
305 | ||
306 | <refsect2> | |
307 | <title><!-- Stop signal -->強制停止時のシグナル</title> | |
308 | <para> | |
309 | <!-- | |
2513f519 KY |
310 | Allows one to specify signal name or number to forcibly shutdown the |
311 | container. This option allows signal to be specified in kill(1) fashion, | |
312 | e.g. SIGKILL, SIGRTMIN+14, SIGRTMAX-10 or plain number. The default | |
313 | signal is SIGKILL. | |
ea4cadbf | 314 | --> |
2513f519 | 315 | コンテナを強制的にシャットダウンするために送るシグナル名か番号を指定できます。このオプションではシグナルとして kill(1) で使う形式を指定できます。 |
dc421f3a | 316 | 例えば SIGKILL, SIGRTMIN+14, SIGRTMAX-10 のような形式、もしくは数字を指定します。デフォルトのシグナルは SIGKILL です。 |
fb261f53 KY |
317 | </para> |
318 | <variablelist> | |
ea4cadbf KY |
319 | <varlistentry> |
320 | <term> | |
55c84efc | 321 | <option>lxc.signal.stop</option> |
ea4cadbf KY |
322 | </term> |
323 | <listitem> | |
324 | <para> | |
325 | <!-- | |
326 | specify the signal used to stop the container | |
327 | --> | |
328 | コンテナを停止するのに使用するシグナルを指定します。 | |
329 | </para> | |
330 | </listitem> | |
331 | </varlistentry> | |
fb261f53 KY |
332 | </variablelist> |
333 | </refsect2> | |
334 | ||
c881c406 KY |
335 | <refsect2> |
336 | <title><!-- Init command -->Init コマンド</title> | |
337 | <para> | |
338 | <!-- | |
339 | Sets the command to use as the init system for the containers. | |
c881c406 KY |
340 | --> |
341 | コンテナの init として使うコマンドを設定します。 | |
c881c406 | 342 | </para> |
fcd95ae9 KY |
343 | <variablelist> |
344 | <varlistentry> | |
345 | <term> | |
346 | <option>lxc.execute.cmd</option> | |
347 | </term> | |
348 | <listitem> | |
349 | <para> | |
350 | <!-- | |
351 | Absolute path from container rootfs to the binary to run by default. This | |
352 | mostly makes sense for lxc-execute. | |
353 | --> | |
354 | デフォルトで実行するバイナリのコンテナの root からの絶対パスを指定します。これは <command>lxc-execute</command> のための設定です。 | |
355 | </para> | |
356 | </listitem> | |
357 | </varlistentry> | |
358 | </variablelist> | |
c881c406 KY |
359 | <variablelist> |
360 | <varlistentry> | |
361 | <term> | |
9dcf7b4d | 362 | <option>lxc.init.cmd</option> |
c881c406 KY |
363 | </term> |
364 | <listitem> | |
365 | <para> | |
366 | <!-- | |
fcd95ae9 KY |
367 | Absolute path from container rootfs to the binary to use as init. This |
368 | mostly makes sense for lxc-start. Default is /sbin/init. | |
c881c406 | 369 | --> |
fcd95ae9 | 370 | init として使うバイナリの、コンテナの root からの絶対パスを指定します。これは <command>lxc-start</command> のための設定です。デフォルトは <command>/sbin/init</command> です。 |
c881c406 KY |
371 | </para> |
372 | </listitem> | |
373 | </varlistentry> | |
374 | </variablelist> | |
375 | </refsect2> | |
376 | ||
7ee64c0f KY |
377 | <refsect2> |
378 | <title><!-- Init ID -->Init が使う ID</title> | |
379 | <para> | |
50a8555e | 380 | <!-- |
2513f519 KY |
381 | Sets the UID/GID to use for the init system, and subsequent commands. |
382 | Note that using a non-root uid when booting a system container will | |
383 | likely not work due to missing privileges. Setting the UID/GID is mostly | |
384 | useful when running application container. | |
7ee64c0f | 385 | |
7ee64c0f | 386 | Defaults to: UID(0), GID(0) |
50a8555e KY |
387 | --> |
388 | init と後続のコマンドが使う UID/GID を設定します。システムコンテナを起動するのに非 root な UID を使うと、特権がないために動作しないでしょう。UID/GID の指定は、通常はアプリケーションコンテナの動作の際に役に立ちます。 | |
2513f519 | 389 | |
50a8555e | 390 | デフォルト値: UID(0)、GID(0) |
7ee64c0f KY |
391 | </para> |
392 | <variablelist> | |
393 | <varlistentry> | |
394 | <term> | |
9dcf7b4d | 395 | <option>lxc.init.uid</option> |
7ee64c0f KY |
396 | </term> |
397 | <listitem> | |
398 | <para> | |
50a8555e KY |
399 | <!-- |
400 | UID to use for init. | |
401 | --> | |
2513f519 | 402 | init が使う UID です。 |
7ee64c0f KY |
403 | </para> |
404 | </listitem> | |
405 | </varlistentry> | |
406 | <varlistentry> | |
407 | <term> | |
9dcf7b4d | 408 | <option>lxc.init.gid</option> |
7ee64c0f KY |
409 | </term> |
410 | <listitem> | |
411 | <para> | |
412 | <!-- | |
2513f519 | 413 | GID to use for init. |
7ee64c0f | 414 | --> |
2513f519 | 415 | init が使う GID です。 |
7ee64c0f KY |
416 | </para> |
417 | </listitem> | |
418 | </varlistentry> | |
419 | </variablelist> | |
420 | </refsect2> | |
421 | ||
7346eb3a KY |
422 | <refsect2> |
423 | <title><!-- Ephemeral -->一時的なコンテナ</title> | |
424 | <para> | |
425 | <!-- | |
426 | Allows one to specify whether a container will be destroyed on shutdown. | |
427 | --> | |
428 | シャットダウン後にコンテナを削除するかどうかを指定できます。 | |
429 | </para> | |
430 | <variablelist> | |
431 | <varlistentry> | |
432 | <term> | |
433 | <option>lxc.ephemeral</option> | |
434 | </term> | |
435 | <listitem> | |
436 | <para> | |
437 | <!-- | |
438 | The only allowed values are 0 and 1. Set this to 1 to destroy a | |
439 | container on shutdown. | |
440 | --> | |
441 | 指定できる値は 0 または 1 のみです。この値を 1 に設定すると、シャットダウン後にコンテナを削除します。 | |
442 | </para> | |
443 | </listitem> | |
444 | </varlistentry> | |
445 | </variablelist> | |
446 | </refsect2> | |
447 | ||
fb261f53 KY |
448 | <refsect2> |
449 | <title><!-- Network -->ネットワーク</title> | |
450 | <para> | |
451 | <!-- | |
50a8555e KY |
452 | The network section defines how the network is virtualized in |
453 | the container. The network virtualization acts at layer | |
454 | two. In order to use the network virtualization, parameters | |
455 | must be specified to define the network interfaces of the | |
456 | container. Several virtual interfaces can be assigned and used | |
457 | in a container even if the system has only one physical | |
458 | network interface. | |
fb261f53 | 459 | --> |
dc421f3a KY |
460 | ネットワークセクションは、コンテナ内でどのようにネットワークを仮想化するかを定義します。 |
461 | ネットワークの仮想化はレイヤー 2 で作動します。 | |
462 | ネットワークの仮想化を使用するためには、コンテナのネットワークインターフェースを定義しなければなりません。 | |
463 | いくつかの仮想インターフェースをアサインすることができます。 | |
464 | そして、仮に物理ネットワークインターフェースが一つしかなくても、コンテナ内でいくつもの仮想インターフェースを使うことができます。 | |
fb261f53 KY |
465 | </para> |
466 | <variablelist> | |
3f45936b KY |
467 | <varlistentry> |
468 | <term> | |
7fa3f2e9 | 469 | <option>lxc.net</option> |
3f45936b KY |
470 | </term> |
471 | <listitem> | |
472 | <para> | |
473 | <!-- | |
474 | may be used without a value to clear all previous network options. | |
475 | --> | |
476 | 値を指定せずに使い、それ以前に定義されたすべてのネットワークオプションをクリアできます。 | |
477 | </para> | |
478 | </listitem> | |
479 | </varlistentry> | |
50a8555e KY |
480 | <varlistentry> |
481 | <term> | |
7fa3f2e9 | 482 | <option>lxc.net.[i].type</option> |
50a8555e KY |
483 | </term> |
484 | <listitem> | |
2513f519 | 485 | <para> |
50a8555e | 486 | <!-- |
2513f519 KY |
487 | specify what kind of network virtualization to be used |
488 | for the container. | |
489 | Multiple networks can be specified by using an additional index | |
490 | <option>i</option> | |
7fa3f2e9 | 491 | after all <option>lxc.net.*</option> keys. For example, |
492 | <option>lxc.net.0.type = veth</option> and | |
493 | <option>lxc.net.1.type = veth</option> specify two different | |
2513f519 KY |
494 | networks of the same type. All keys sharing the same index |
495 | <option>i</option> will be treated as belonging to the same | |
7fa3f2e9 | 496 | network. For example, <option>lxc.net.0.link = br0</option> |
497 | will belong to <option>lxc.net.0.type</option>. | |
2513f519 | 498 | Currently, the different virtualization types can be: |
50a8555e | 499 | --> |
7fa3f2e9 | 500 | コンテナがどの種類のネットワーク仮想化を使うかを指定します。すべての <option>lxc.net.*</option> キーに、追加のインデックス <option>i</option> を使うと、複数のネットワークを指定できます。例えば、<option>lxc.net.0.type = veth</option> と <option>lxc.net.1.type = veth</option> は、同じタイプの異なるネットワークを 2 つ指定します。 |
501 | 同じインデックスを指定したキーはすべて同じネットワークの指定になります。例えば、<option>lxc.net.0.link = br0</option> は <option>lxc.net.0.type</option> と同じネットワークの設定になります。 | |
50a8555e | 502 | 現時点では、以下のネットワーク仮想化のタイプが使えます: |
2513f519 | 503 | </para> |
fb261f53 | 504 | |
50a8555e | 505 | <para> |
fb261f53 | 506 | <!-- |
50a8555e KY |
507 | <option>none:</option> will cause the container to share |
508 | the host's network namespace. This means the host | |
509 | network devices are usable in the container. It also | |
510 | means that if both the container and host have upstart as | |
511 | init, 'halt' in a container (for instance) will shut down the | |
512 | host. | |
fb261f53 | 513 | --> |
dc421f3a KY |
514 | <option>none:</option> ホストのネットワーク名前空間を共有します。 |
515 | これにより、ホストのネットワークデバイスをコンテナ内で使うことが可能になります。 | |
516 | もしコンテナもホストも init として upstart を使っている場合、(例えば) コンテナ内で 'halt' を実行すると、ホストがシャットダウンしてしまうことにもなります。 | |
50a8555e | 517 | </para> |
fb261f53 | 518 | |
50a8555e | 519 | <para> |
fb261f53 | 520 | <!-- |
50a8555e KY |
521 | <option>empty:</option> will create only the loopback |
522 | interface. | |
fb261f53 | 523 | --> |
50a8555e KY |
524 | <option>empty:</option> ループバックインターフェースだけを作成します。 |
525 | </para> | |
fb261f53 | 526 | |
ac11ab33 | 527 | <para> |
fb261f53 | 528 | <!-- |
ac11ab33 KY |
529 | <option>veth:</option> a virtual ethernet pair |
530 | device is created with one side assigned to the container | |
531 | and the other side attached to a bridge specified by | |
7fa3f2e9 | 532 | the <option>lxc.net.[i].link</option> option. |
ac11ab33 KY |
533 | If the bridge is not specified, then the veth pair device |
534 | will be created but not attached to any bridge. | |
535 | Otherwise, the bridge has to be created on the system | |
536 | before starting the container. | |
537 | <command>lxc</command> won't handle any | |
538 | configuration outside of the container. | |
539 | By default, <command>lxc</command> chooses a name for the | |
540 | network device belonging to the outside of the | |
541 | container, but if you wish to handle | |
542 | this name yourselves, you can tell <command>lxc</command> | |
543 | to set a specific name with | |
7fa3f2e9 | 544 | the <option>lxc.net.[i].veth.pair</option> option (except for |
ac11ab33 KY |
545 | unprivileged containers where this option is ignored for security |
546 | reasons). | |
fb261f53 | 547 | --> |
7fa3f2e9 | 548 | <option>veth:</option > 一方がコンテナに、もう一方が <option>lxc.net.[i].link</option> オプションで指定されたブリッジに接続されるペアの仮想イーサネットデバイスを作成します。 |
ac11ab33 KY |
549 | もし、ブリッジが指定されていない場合、veth ペアデバイスは作成されますが、ブリッジには接続されません。 |
550 | ブリッジはコンテナが開始する前にシステムで事前に設定しておく必要があります。 | |
551 | <command>lxc</command> はコンテナ外の設定を扱うことはありません。 | |
552 | デフォルトでは、<command>lxc</command> がコンテナの外部に属するネットワークデバイスに対する名前を決定します。 | |
7fa3f2e9 | 553 | しかし、もしこの名前を自分で指定したい場合、<option>lxc.net.[i].veth.pair</option> オプションを使って名前を設定し、lxc に対して指定をすることができます (非特権コンテナの場合をのぞきます。セキュリティ上の理由からこのオプションは無視されます)。 |
ac11ab33 | 554 | </para> |
fb261f53 | 555 | |
50a8555e | 556 | <para> |
fb261f53 | 557 | <!-- |
50a8555e KY |
558 | <option>vlan:</option> a vlan interface is linked with |
559 | the interface specified by | |
7fa3f2e9 | 560 | the <option>lxc.net.[i].link</option> and assigned to |
50a8555e | 561 | the container. The vlan identifier is specified with the |
7fa3f2e9 | 562 | option <option>lxc.net.[i].vlan.id</option>. |
fb261f53 | 563 | --> |
7fa3f2e9 | 564 | <option>vlan:</option> vlan インターフェースは <option>lxc.net.[i].link</option> で指定されたインターフェースとリンクし、コンテナに割り当てられます。 |
565 | vlan の指定は <option>lxc.net.[i].vlan.id</option> オプションで指定します。 | |
50a8555e | 566 | </para> |
fb261f53 | 567 | |
50a8555e | 568 | <para> |
fb261f53 | 569 | <!-- |
50a8555e KY |
570 | <option>macvlan:</option> a macvlan interface is linked |
571 | with the interface specified by | |
7fa3f2e9 | 572 | the <option>lxc.net.[i].link</option> and assigned to |
50a8555e | 573 | the container. |
7fa3f2e9 | 574 | <option>lxc.net.[i].macvlan.mode</option> specifies the |
50a8555e KY |
575 | mode the macvlan will use to communicate between |
576 | different macvlan on the same upper device. The accepted | |
5a56eeb6 KY |
577 | modes are <option>private</option>, <option>vepa</option>, |
578 | <option>bridge</option> and <option>passthru</option>. | |
50a8555e | 579 | In <option>private</option> mode, the device never |
5a56eeb6 KY |
580 | communicates with any other device on the same upper_dev (default). |
581 | In <option>vepa</option> mode, the new Virtual Ethernet Port | |
50a8555e KY |
582 | Aggregator (VEPA) mode, it assumes that the adjacent |
583 | bridge returns all frames where both source and | |
584 | destination are local to the macvlan port, i.e. the | |
585 | bridge is set up as a reflective relay. Broadcast | |
586 | frames coming in from the upper_dev get flooded to all | |
587 | macvlan interfaces in VEPA mode, local frames are not | |
5a56eeb6 | 588 | delivered locally. In <option>bridge</option> mode, it |
50a8555e KY |
589 | provides the behavior of a simple bridge between |
590 | different macvlan interfaces on the same port. Frames | |
591 | from one interface to another one get delivered directly | |
592 | and are not sent out externally. Broadcast frames get | |
593 | flooded to all other bridge ports and to the external | |
594 | interface, but when they come back from a reflective | |
595 | relay, we don't deliver them again. Since we know all | |
596 | the MAC addresses, the macvlan bridge mode does not | |
5a56eeb6 KY |
597 | require learning or STP like the bridge module does. In |
598 | <option>passthru</option> mode, all frames received by | |
599 | the physical interface are forwarded to the macvlan | |
600 | interface. Only one macvlan interface in <option>passthru</option> | |
601 | mode is possible for one physical interface. | |
fb261f53 | 602 | --> |
7fa3f2e9 | 603 | <option>macvlan:</option> macvlan インターフェースは <option>lxc.net.[i].link</option> により指定されるインターフェースとリンクし、コンテナに割り当てられます。 |
604 | <option>lxc.net.[i].macvlan.mode</option> でモードを指定すると、その macvlan の指定を、同じ上位デバイスで異なる macvlan の間の通信をする時に使います。 | |
5a56eeb6 KY |
605 | 指定できるモードは <option>private</option>、<option>vepa</option>、<option>bridge</option>、<option>passthru</option> のいずれかです。 |
606 | <option>private</option> モードの場合、デバイスは同じ上位デバイスの他のデバイスとの通信を行いません (デフォルト)。 | |
607 | 新しい仮想イーサネットポート集約モード (Virtual Ethernet Port Aggregator (VEPA)) である <option>vepa</option> モードの場合、隣接したポートが、ソースとデスティネーションの両方が macvlan ポートに対してローカルであるフレームを全て返すと仮定します。 | |
dc421f3a KY |
608 | すなわち、ブリッジが reflective relay として設定されているということです。 |
609 | 上位デバイスから入ってくるブロードキャストフレームは、VEPA モードである全ての macvlan インターフェースに送りつけられます。 | |
610 | ローカルのフレームはローカルには配送されません。 | |
5a56eeb6 | 611 | <option>bridge</option> モードの場合、同じポートの異なる macvlan インターフェースの間のシンプルなブリッジとして動作します。 |
dc421f3a KY |
612 | あるインターフェースから他のインターフェースへのフレームは、直接配送され、外部には送出されません。 |
613 | ブロードキャストフレームは、全ての他のブリッジと外部のインターフェースに対して送られます。 | |
614 | しかし、reflective relay からフレームが返ってきたときは、再度それを配送することはしません。 | |
615 | 全ての MAC アドレスを知っているので、ブリッジモジュールのように、macvlan ブリッジモードは学習や STP の必要はありません。 | |
5a56eeb6 | 616 | <option>passthru</option> モードの場合、物理インターフェースで受け取った全てのフレームは macvlan インターフェースに転送されます。<option>passthru</option> モードの場合、ひとつの macvlan インターフェースだけが、ひとつの物理インターフェースに対して設定できます。 |
50a8555e | 617 | </para> |
fb261f53 | 618 | |
50a8555e | 619 | <para> |
fb261f53 | 620 | <!-- |
50a8555e | 621 | <option>phys:</option> an already existing interface |
7fa3f2e9 | 622 | specified by the <option>lxc.net.[i].link</option> is |
50a8555e | 623 | assigned to the container. |
fb261f53 | 624 | --> |
7fa3f2e9 | 625 | <option>phys:</option> <option>lxc.net.[i].link</option> で指定された、すでに存在しているインターフェースがコンテナに割り当てられます。 |
50a8555e KY |
626 | </para> |
627 | </listitem> | |
628 | </varlistentry> | |
fb261f53 | 629 | |
50a8555e KY |
630 | <varlistentry> |
631 | <term> | |
7fa3f2e9 | 632 | <option>lxc.net.[i].flags</option> |
50a8555e KY |
633 | </term> |
634 | <listitem> | |
635 | <para> | |
fb261f53 | 636 | <!-- |
2513f519 | 637 | Specify an action to do for the network. |
fb261f53 | 638 | --> |
dc421f3a | 639 | ネットワークに対して行うアクションを指定します。 |
50a8555e | 640 | </para> |
fb261f53 | 641 | |
50a8555e | 642 | <para> |
fb261f53 KY |
643 | <!-- |
644 | <option>up:</option> activates the interface. | |
645 | --> | |
dc421f3a | 646 | <option>up:</option> インターフェースを起動させます。 |
50a8555e KY |
647 | </para> |
648 | </listitem> | |
649 | </varlistentry> | |
fb261f53 | 650 | |
50a8555e KY |
651 | <varlistentry> |
652 | <term> | |
7fa3f2e9 | 653 | <option>lxc.net.[i].link</option> |
50a8555e KY |
654 | </term> |
655 | <listitem> | |
656 | <para> | |
fb261f53 | 657 | <!-- |
2513f519 | 658 | Specify the interface to be used for real network traffic. |
fb261f53 | 659 | --> |
dc421f3a | 660 | 実際のネットワークトラフィックに使うインターフェースを指定します。 |
50a8555e KY |
661 | </para> |
662 | </listitem> | |
663 | </varlistentry> | |
fb261f53 | 664 | |
50a8555e KY |
665 | <varlistentry> |
666 | <term> | |
7fa3f2e9 | 667 | <option>lxc.net.[i].mtu</option> |
50a8555e KY |
668 | </term> |
669 | <listitem> | |
670 | <para> | |
fb261f53 | 671 | <!-- |
2513f519 | 672 | Specify the maximum transfer unit for this interface. |
fb261f53 | 673 | --> |
dc421f3a | 674 | インターフェースに対する MTU を指定します。 |
50a8555e KY |
675 | </para> |
676 | </listitem> | |
677 | </varlistentry> | |
fb261f53 | 678 | |
50a8555e KY |
679 | <varlistentry> |
680 | <term> | |
7fa3f2e9 | 681 | <option>lxc.net.[i].name</option> |
50a8555e KY |
682 | </term> |
683 | <listitem> | |
684 | <para> | |
fb261f53 | 685 | <!-- |
2513f519 KY |
686 | The interface name is dynamically allocated, but if another name |
687 | is needed because the configuration files being used by the | |
688 | container use a generic name, eg. eth0, this option will rename | |
689 | the interface in the container. | |
fb261f53 | 690 | --> |
2513f519 | 691 | インターフェース名は動的に割り当てられます。しかし、もしコンテナが使用する設定ファイルが一般的な名前を使用するために、他の特定の名前が必要であれば (例えば eth0 など)、コンテナ内のインターフェースは、このオプションで指定した名前にリネームされます。 |
50a8555e KY |
692 | </para> |
693 | </listitem> | |
694 | </varlistentry> | |
fb261f53 | 695 | |
50a8555e KY |
696 | <varlistentry> |
697 | <term> | |
7fa3f2e9 | 698 | <option>lxc.net.[i].hwaddr</option> |
50a8555e KY |
699 | </term> |
700 | <listitem> | |
701 | <para> | |
fb261f53 | 702 | <!-- |
2513f519 KY |
703 | The interface mac address is dynamically allocated by default to |
704 | the virtual interface, but in some cases, this is needed to | |
705 | resolve a mac address conflict or to always have the same | |
706 | link-local ipv6 address. Any "x" in address will be replaced by | |
707 | random value, this allows setting hwaddr templates. | |
708 | --> | |
709 | 仮想インターフェースの MAC アドレスは、デフォルトでは動的に割り当てられます。しかし、MAC アドレスの衝突や、リンクローカルIPv6 アドレスを常に同じにした場合などは、このオプションが必要です。アドレス中の "x" という文字は、ランダムな値に置き換えられます。これによりテンプレートに hwaddr を設定することが可能になります。 | |
50a8555e KY |
710 | </para> |
711 | </listitem> | |
712 | </varlistentry> | |
fb261f53 | 713 | |
50a8555e KY |
714 | <varlistentry> |
715 | <term> | |
e71b47b2 | 716 | <option>lxc.net.[i].ipv4.address</option> |
50a8555e KY |
717 | </term> |
718 | <listitem> | |
719 | <para> | |
fb261f53 | 720 | <!-- |
2513f519 KY |
721 | Specify the ipv4 address to assign to the virtualized interface. |
722 | Several lines specify several ipv4 addresses. The address is in | |
723 | format x.y.z.t/m, eg. 192.168.1.123/24. | |
724 | --> | |
725 | 仮想インターフェースに割り当てる ipv4 アドレスを指定します。複数行により複数の ipv4 アドレスを指定します。このアドレスは x.y.z.t/m というフォーマットで指定します。例) 192.168.1.123/24 | |
50a8555e KY |
726 | </para> |
727 | </listitem> | |
728 | </varlistentry> | |
729 | ||
730 | <varlistentry> | |
731 | <term> | |
7fa3f2e9 | 732 | <option>lxc.net.[i].ipv4.gateway</option> |
50a8555e KY |
733 | </term> |
734 | <listitem> | |
735 | <para> | |
736 | <!-- | |
737 | specify the ipv4 address to use as the gateway inside the | |
738 | container. The address is in format x.y.z.t, eg. 192.168.1.123. | |
739 | ||
740 | Can also have the special value <option>auto</option>, | |
741 | which means to take the primary address from the bridge | |
742 | interface (as specified by the | |
7fa3f2e9 | 743 | <option>lxc.net.[i].link</option> option) and use that as |
50a8555e KY |
744 | the gateway. <option>auto</option> is only available when |
745 | using the <option>veth</option> and | |
746 | <option>macvlan</option> network types. | |
fb261f53 | 747 | --> |
2513f519 | 748 | コンテナでゲートウェイとして使う IPv4 アドレスを指定します。アドレスは x.y.z.t というフォーマットです。例) 192.168.1.123 |
7fa3f2e9 | 749 | <option>auto</option> という特別な値を指定できます。これは (<option>lxc.net.[i].link</option> で指定した) ブリッジインターフェースの最初のアドレスを使用し、それをゲートウェイに使うという意味になります。<option>auto</option> はネットワークタイプとして <option>veth</option> と <option>macvlan</option> を指定している時だけ有効となります。 |
50a8555e KY |
750 | </para> |
751 | </listitem> | |
752 | </varlistentry> | |
fb261f53 KY |
753 | |
754 | ||
50a8555e KY |
755 | <varlistentry> |
756 | <term> | |
e71b47b2 | 757 | <option>lxc.net.[i].ipv6.address</option> |
50a8555e KY |
758 | </term> |
759 | <listitem> | |
760 | <para> | |
fb261f53 | 761 | <!-- |
2513f519 KY |
762 | Specify the ipv6 address to assign to the virtualized |
763 | interface. Several lines specify several ipv6 addresses. The | |
764 | address is in format x::y/m, eg. | |
765 | 2003:db8:1:0:214:1234:fe0b:3596/64 | |
fb261f53 | 766 | --> |
2513f519 | 767 | 仮想インターフェースに割り当てる ipv6 アドレスを指定します。複数行により複数の ipv6 アドレスを指定します。このアドレスは x::y/m というフォーマットで指定します。例) 2003:db8:1:0:214:1234:fe0b:3596/64 |
50a8555e KY |
768 | </para> |
769 | </listitem> | |
770 | </varlistentry> | |
fb261f53 | 771 | |
50a8555e KY |
772 | <varlistentry> |
773 | <term> | |
7fa3f2e9 | 774 | <option>lxc.net.[i].ipv6.gateway</option> |
50a8555e KY |
775 | </term> |
776 | <listitem> | |
777 | <para> | |
fb261f53 | 778 | <!-- |
2513f519 KY |
779 | Specify the ipv6 address to use as the gateway inside the |
780 | container. The address is in format x::y, eg. 2003:db8:1:0::1 | |
fb261f53 | 781 | |
50a8555e KY |
782 | Can also have the special value <option>auto</option>, |
783 | which means to take the primary address from the bridge | |
784 | interface (as specified by the | |
7fa3f2e9 | 785 | <option>lxc.net.[i].link</option> option) and use that as |
50a8555e KY |
786 | the gateway. <option>auto</option> is only available when |
787 | using the <option>veth</option> and | |
788 | <option>macvlan</option> network types. | |
fb261f53 | 789 | --> |
2513f519 | 790 | コンテナでゲートウェイとして使う IPv6 アドレスを指定します。アドレスは x::y というフォーマットです。例) 2003:db8:1:0::1 |
7fa3f2e9 | 791 | <option>auto</option> という特別な値を記述する事も可能です。これは (<option>lxc.net.[i].link</option> で指定した) ブリッジインターフェースの最初のアドレスを使用し、それをゲートウェイに使うという意味になります。<option>auto</option> はネットワークタイプとして <option>veth</option> と <option>macvlan</option> を指定している時だけ有効となります。 |
50a8555e KY |
792 | </para> |
793 | </listitem> | |
794 | </varlistentry> | |
795 | ||
796 | <varlistentry> | |
797 | <term> | |
7fa3f2e9 | 798 | <option>lxc.net.[i].script.up</option> |
50a8555e KY |
799 | </term> |
800 | <listitem> | |
801 | <para> | |
802 | <!-- | |
803 | add a configuration option to specify a script to be | |
804 | executed after creating and configuring the network used | |
805 | from the host side. The following arguments are passed | |
806 | to the script: container name and config section name | |
807 | (net) Additional arguments depend on the config section | |
808 | employing a script hook; the following are used by the | |
809 | network system: execution context (up), network type | |
810 | (empty/veth/macvlan/phys), Depending on the network | |
811 | type, other arguments may be passed: | |
812 | veth/macvlan/phys. And finally (host-sided) device name. | |
fb261f53 | 813 | --> |
2513f519 | 814 | ホスト側から使われる、ネットワークの作成と設定が済んだ後に実行するスクリプトを指定します。以下の引数がスクリプトに渡されます: コンテナ名、設定セクション名(net)。 |
50a8555e | 815 | その後の引数はスクリプトのフックで使われる設定セクションに依存します。以下がネットワークシステムによって使われます: 実行コンテキスト (up)、ネットワークのタイプ (empty/veth/macvlan/phys) |
dc421f3a | 816 | ネットワークのタイプによっては、更に別の引数が渡されるかもしれません: veth/macvlan/phys の場合 (ホスト側の) デバイス名 |
fb261f53 | 817 | </para> |
50a8555e | 818 | <para> |
fb261f53 | 819 | <!-- |
50a8555e KY |
820 | Standard output from the script is logged at debug level. |
821 | Standard error is not logged, but can be captured by the | |
822 | hook redirecting its standard error to standard output. | |
fb261f53 | 823 | --> |
2513f519 | 824 | スクリプトからの標準出力は debug レベルでロギングされます。標準エラー出力はロギングされません。しかし、フックの標準エラー出力を標準出力にリダイレクトすることにより保存することは可能です。 |
50a8555e KY |
825 | </para> |
826 | </listitem> | |
827 | </varlistentry> | |
828 | ||
829 | <varlistentry> | |
830 | <term> | |
7fa3f2e9 | 831 | <option>lxc.net.[i].script.down</option> |
50a8555e KY |
832 | </term> |
833 | <listitem> | |
834 | <para> | |
835 | <!-- | |
836 | add a configuration option to specify a script to be | |
837 | executed before destroying the network used from the | |
838 | host side. The following arguments are passed to the | |
839 | script: container name and config section name (net) | |
840 | Additional arguments depend on the config section | |
841 | employing a script hook; the following are used by the | |
842 | network system: execution context (down), network type | |
843 | (empty/veth/macvlan/phys), Depending on the network | |
844 | type, other arguments may be passed: | |
845 | veth/macvlan/phys. And finally (host-sided) device name. | |
fb261f53 | 846 | --> |
2513f519 KY |
847 | ホスト側から使われる、ネットワークを破壊する前に実行するスクリプトを指定します。以下の引数がスクリプトに渡されます: コンテナ名、設定セクション名(net)。 |
848 | その後の引数はスクリプトのフックで使われる設定セクションに依存します。以下がネットワークシステムによって使われます: 実行コンテキスト (up)、ネットワークのタイプ (empty/veth/macvlan/phys)。 | |
dc421f3a | 849 | ネットワークのタイプによっては、更に別の引数が渡されるかもしれません: veth/macvlan/phys。そして最後に (ホスト側の) デバイス名が渡されます。 |
fb261f53 | 850 | </para> |
50a8555e | 851 | <para> |
fb261f53 | 852 | <!-- |
50a8555e KY |
853 | Standard output from the script is logged at debug level. |
854 | Standard error is not logged, but can be captured by the | |
855 | hook redirecting its standard error to standard output. | |
fb261f53 | 856 | --> |
2513f519 | 857 | スクリプトからの標準出力は debug レベルでロギングされます。標準エラー出力はロギングされません。しかし、フックの標準エラー出力を標準出力にリダイレクトすることにより保存することは可能です。 |
50a8555e KY |
858 | </para> |
859 | </listitem> | |
860 | </varlistentry> | |
fb261f53 KY |
861 | </variablelist> |
862 | ||
863 | </refsect2> | |
864 | ||
865 | <refsect2> | |
866 | <title><!-- New pseudo tty instance (devpts) -->新しい擬似端末のインスタンス (devpts)</title> | |
867 | <para> | |
868 | <!-- | |
50a8555e KY |
869 | For stricter isolation the container can have its own private |
870 | instance of the pseudo tty. | |
fb261f53 | 871 | --> |
dc421f3a | 872 | さらに厳しい隔離のために、コンテナは自身のプライベートな pseudo tty (擬似端末) を持つことが可能です。 |
fb261f53 KY |
873 | </para> |
874 | <variablelist> | |
50a8555e KY |
875 | <varlistentry> |
876 | <term> | |
e71b47b2 | 877 | <option>lxc.pty.max</option> |
50a8555e KY |
878 | </term> |
879 | <listitem> | |
880 | <para> | |
881 | <!-- | |
882 | If set, the container will have a new pseudo tty | |
883 | instance, making this private to it. The value specifies | |
fb261f53 KY |
884 | the maximum number of pseudo ttys allowed for a pts |
885 | instance (this limitation is not implemented yet). | |
886 | --> | |
ec64264d | 887 | もし設定された場合、コンテナは新しい pseudo tty インスタンスを持ち、それを自身のプライベートとします。 |
dc421f3a | 888 | この値は pts インスタンスに許可される pseudo tty の最大数を指定します (この制限はまだ実装されていません)。 |
50a8555e KY |
889 | </para> |
890 | </listitem> | |
891 | </varlistentry> | |
fb261f53 KY |
892 | </variablelist> |
893 | </refsect2> | |
894 | ||
895 | <refsect2> | |
896 | <title><!-- Container system console -->コンテナのシステムコンソール</title> | |
897 | <para> | |
898 | <!-- | |
50a8555e KY |
899 | If the container is configured with a root filesystem and the |
900 | inittab file is setup to use the console, you may want to specify | |
901 | where the output of this console goes. | |
fb261f53 | 902 | --> |
dc421f3a | 903 | コンテナでルートファイルシステムを持つように設定されており、inittab ファイルでコンソールの使用が設定されている場合、このコンソールの出力がどこになされるのかを指定したいと思うでしょう。 |
fb261f53 KY |
904 | </para> |
905 | <variablelist> | |
4d94eb7d KY |
906 | |
907 | <varlistentry> | |
908 | <term> | |
909 | <option>lxc.console.buffer.size</option> | |
910 | </term> | |
911 | <listitem> | |
912 | <para> | |
913 | <!-- | |
914 | Setting this option instructs liblxc to allocate an in-memory | |
915 | ringbuffer. The container's console output will be written to the | |
916 | ringbuffer. Note that ringbuffer must be at least as big as a | |
917 | standard page size. When passed a value smaller than a single page | |
918 | size liblxc will allocate a ringbuffer of a single page size. A page | |
919 | size is usually 4kB. | |
920 | --> | |
921 | このオプションを設定すると、liblxc はインメモリのリングバッファを割り当てます。コンテナのコンソールはリングバッファに出力されます。リングバッファは少なくとも標準ページサイズの大きさでなければなりません。ページサイズより小さい値を与えた場合は、liblxc はページサイズのリングバッファを割り当てます。ページサイズは通常は 4kB です。 | |
922 | ||
923 | <!-- | |
924 | The keyword 'auto' will cause liblxc to allocate a ringbuffer of | |
925 | 128kB. | |
926 | --> | |
927 | 'auto' を指定すると、liblxc は 128kB のリングバッファを割り当てます。 | |
928 | ||
929 | <!-- | |
930 | When manually specifying a size for the ringbuffer the value should | |
931 | be a power of 2 when converted to bytes. Valid size prefixes are | |
932 | 'kB', 'MB', 'GB'. (Note that all conversions are based on multiples | |
933 | of 1024. That means 'kb' == 'KiB', 'MB' == 'MiB', 'GB' == 'GiB'.) | |
934 | --> | |
935 | リングバッファサイズを数値指定する場合、値がバイトに変換されるときに 2 の累乗になります。サイズ接頭辞付きの単位として 'kB'、'MB'、'GB' が使えます。(この場合の変換は 1024 の倍数に基づいています。つまり 'kB' == 'KiB'、'MB' == 'MiB'、'GB' == 'GiB' という意味です。) | |
936 | </para> | |
937 | </listitem> | |
938 | </varlistentry> | |
939 | ||
940 | <varlistentry> | |
941 | <term> | |
942 | <option>lxc.console.buffer.logfile</option> | |
943 | </term> | |
944 | <listitem> | |
945 | <para> | |
946 | <!-- | |
947 | Setting this option instructs liblxc to write the in-memory | |
948 | ringbuffer to disk. For performance reasons liblxc will only write | |
949 | the in-memory ringbuffer to disk when requested. Note that the this | |
950 | option is only used by liblxc when | |
951 | <option>lxc.console.buffer.size</option> is set. | |
952 | --> | |
953 | このオプションを設定すると、liblxc はインメモリのリングバッファをディスクに書き込みます。パフォーマンスを考慮して、liblxc は指定をした場合に限り、インメモリのリングバッファをディスクに書き込みます。liblxc はこのオプションを、<option>lxc.console.buffer.size</option> が指定された場合のみ使います。 | |
954 | ||
955 | <!-- | |
956 | By default liblxc will dump the contents of the in-memory ringbuffer | |
957 | to disk when the container terminates. This allows users to diagnose | |
958 | boot failures when the container crashed before an API request to | |
959 | retrieve the in-memory ringbuffer could be sent or handled. | |
960 | --> | |
961 | デフォルトでは liblxc は、コンテナが終了した際にインメモリのリングバッファの内容をディスクに書き出します。これによりユーザは、インメモリのリングバッファを取得する API リクエストが送られたり処理される前に、コンテナがクラッシュした場合、ブートの失敗を調査できます。 | |
962 | </para> | |
963 | </listitem> | |
964 | </varlistentry> | |
965 | ||
50a8555e KY |
966 | <varlistentry> |
967 | <term> | |
968 | <option>lxc.console.logfile</option> | |
969 | </term> | |
970 | <listitem> | |
971 | <para> | |
fb261f53 | 972 | <!-- |
4d94eb7d KY |
973 | Specify a path to a file where the console output will be written. |
974 | Note that in contrast to the on-disk ringbuffer logfile this file | |
975 | will keep growing potentially filling up the users disks if not | |
976 | rotated and deleted. This problem can also be avoided by using the | |
977 | in-memory ringbuffer options | |
978 | <option>lxc.console.buffer.size</option> and | |
979 | <option>lxc.console.buffer.logfile</option>. | |
48e60dfe | 980 | --> |
4d94eb7d | 981 | コンソール出力を書き込むファイルのパスを指定します。ディスクに保存されるリングバッファログと異なり、このファイルはサイズが大きくなり続けるので、ファイルがローテートや削除されない限りは、ユーザのディスクをいっぱいにしてしまう可能性があります。この問題は、インメモリのリングバッファオプションである、<option>lxc.console.buffer.size</option> と <option>lxc.console.buffer.logfile</option> を使うことでも回避できます。 |
50a8555e KY |
982 | </para> |
983 | </listitem> | |
984 | </varlistentry> | |
4d94eb7d KY |
985 | |
986 | <varlistentry> | |
987 | <term> | |
988 | <option>lxc.console.rotate</option> | |
989 | </term> | |
990 | <listitem> | |
991 | <para> | |
992 | <!-- | |
993 | Whether to rotate the console logfile specified in | |
994 | <option>lxc.console.logfile</option>. Users can send an API | |
995 | request to rotate the logfile. Note that the old logfile will have | |
996 | the same name as the original with the suffix ".1" appended. | |
997 | --> | |
998 | <option>lxc.console.logfile</option> で指定したコンソールログファイルをローテートするかどうかを指定します。ユーザはログファイルをローテートするように API リクエストを送ることができます。古いログファイルは、元のファイル名と同じ名前のファイルに ".1" というサフィックスが付け加わります。 | |
999 | ||
1000 | <!-- | |
1001 | Users wishing to prevent the console log file from filling the | |
1002 | disk should rotate the logfile and delete it if unneeded. This | |
1003 | problem can also be avoided by using the in-memory ringbuffer | |
1004 | options <option>lxc.console.buffer.size</option> and | |
1005 | <option>lxc.console.buffer.logfile</option>. | |
1006 | --> | |
1007 | ユーザがコンソールログでディスクがいっぱいになるのを防ぐには、ログファイルをローテートし、不要なログファイルを削除してください。この問題はインメモリのリングバッファオプションである <option>lxc.console.buffer.size</option> と <option>lxc.console.buffer.logfile</option> を使うことでも防げます。 | |
1008 | </para> | |
1009 | </listitem> | |
1010 | </varlistentry> | |
1011 | ||
50a8555e KY |
1012 | <varlistentry> |
1013 | <term> | |
e71b47b2 | 1014 | <option>lxc.console.path</option> |
50a8555e KY |
1015 | </term> |
1016 | <listitem> | |
7a534f67 | 1017 | <para> |
48e60dfe | 1018 | <!-- |
7a534f67 KY |
1019 | Specify a path to a device to which the console will be |
1020 | attached. The keyword 'none' will simply disable the | |
1021 | console. Note, when specifying 'none' and creating a device node | |
1022 | for the console in the container at /dev/console or bind-mounting | |
1023 | the hosts's /dev/console into the container at /dev/console the | |
1024 | container will have direct access to the hosts's /dev/console. | |
1025 | This is dangerous when the container has write access to the | |
1026 | device and should thus be used with caution. | |
1027 | --> | |
48e60dfe | 1028 | コンソールを割り当てるデバイスのパスを指定します。'none' というキーワードは、単純にコンソールを無効にします。 |
7a534f67 KY |
1029 | 'none' を指定し、コンテナ内のコンソールに対するデバイスノードを /dev/console に作成するか、もしくはホストの /dev/console をコンテナ内の /dev/console に bind mount する場合、そのコンテナはホストの /dev/console へ直接アクセスを行うことに注意が必要です。 |
1030 | そのコンテナがデバイスへの書き込み権を持っている場合は危険ですので、注意してこの指定を使用する必要があります。 | |
1031 | </para> | |
50a8555e KY |
1032 | </listitem> |
1033 | </varlistentry> | |
fb261f53 KY |
1034 | </variablelist> |
1035 | </refsect2> | |
1036 | ||
1037 | <refsect2> | |
1038 | <title><!-- Console through the ttys -->tty を通したコンソール</title> | |
1039 | <para> | |
1040 | <!-- | |
50a8555e KY |
1041 | This option is useful if the container is configured with a root |
1042 | filesystem and the inittab file is setup to launch a getty on the | |
1043 | ttys. The option specifies the number of ttys to be available for | |
1044 | the container. The number of gettys in the inittab file of the | |
1045 | container should not be greater than the number of ttys specified | |
1046 | in this option, otherwise the excess getty sessions will die and | |
1047 | respawn indefinitely giving annoying messages on the console or in | |
1048 | <filename>/var/log/messages</filename>. | |
fb261f53 | 1049 | --> |
dc421f3a KY |
1050 | このオプションはコンテナが root ファイルシステムを持つように設定されており、inittab ファイルで tty 上に getty の起動が設定されている場合に役に立ちます。 |
1051 | このオプションはコンテナで利用できる tty の数を指定します。 | |
1052 | inittab ファイルに設定する getty の数は、このオプションの指定する tty の数より大きくしてはいけません。 | |
1053 | さもなければ、超過した分の getty セッションはコンソールか /var/log/messages にうっとうしいメッセージを生死を表示しながら、永久に生死を繰り返すでしょう。 | |
fb261f53 KY |
1054 | </para> |
1055 | <variablelist> | |
50a8555e KY |
1056 | <varlistentry> |
1057 | <term> | |
e71b47b2 | 1058 | <option>lxc.tty.max</option> |
50a8555e KY |
1059 | </term> |
1060 | <listitem> | |
1061 | <para> | |
fb261f53 | 1062 | <!-- |
50a8555e KY |
1063 | Specify the number of tty to make available to the |
1064 | container. | |
fb261f53 | 1065 | --> |
dc421f3a | 1066 | コンテナに作成出来る tty の数を指定します。 |
50a8555e KY |
1067 | </para> |
1068 | </listitem> | |
1069 | </varlistentry> | |
fb261f53 KY |
1070 | </variablelist> |
1071 | </refsect2> | |
1072 | ||
1073 | <refsect2> | |
1074 | <title><!-- Console devices location -->コンソールデバイスの位置</title> | |
1075 | <para> | |
1076 | <!-- | |
1077 | LXC consoles are provided through Unix98 PTYs created on the | |
50a8555e KY |
1078 | host and bind-mounted over the expected devices in the container. |
1079 | By default, they are bind-mounted over <filename>/dev/console</filename> | |
1080 | and <filename>/dev/ttyN</filename>. This can prevent package upgrades | |
1081 | in the guest. Therefore you can specify a directory location (under | |
1082 | <filename>/dev</filename> under which LXC will create the files and | |
1083 | bind-mount over them. These will then be symbolically linked to | |
1084 | <filename>/dev/console</filename> and <filename>/dev/ttyN</filename>. | |
1085 | A package upgrade can then succeed as it is able to remove and replace | |
1086 | the symbolic links. | |
fb261f53 | 1087 | --> |
dc421f3a KY |
1088 | LXC のコンソールはホストによって作られ、コンテナ内で要求されたデバイスに bind マウントされた Unix98 PTY 経由で提供されます。 |
1089 | デフォルトでは <filename>/dev/console</filename> と <filename>/dev/ttyN</filename> に bind マウントされます。 | |
1090 | これはゲスト内でのパッケージのアップグレードを妨げる可能性があります。 | |
1091 | なので <filename>/dev</filename> 以下のディレクトリを指定することができます。 | |
1092 | LXC はこのディレクトリ以下にファイルを作成し、これらのファイルを bind マウントします。 | |
1093 | そして、これらの (作成された) ファイルは <filename>/dev/console</filename> と <filename>/dev/ttyN</filename> にシンボリックリンクされます。 | |
1094 | シンボリックリンクを消去したり置き換えたりすることは可能ですから、パッケージのアップグレードは成功します。 | |
fb261f53 KY |
1095 | </para> |
1096 | <variablelist> | |
50a8555e KY |
1097 | <varlistentry> |
1098 | <term> | |
e71b47b2 | 1099 | <option>lxc.tty.dir</option> |
50a8555e KY |
1100 | </term> |
1101 | <listitem> | |
7a534f67 | 1102 | <para> |
fb261f53 | 1103 | <!-- |
7a534f67 KY |
1104 | Specify a directory under <filename>/dev</filename> |
1105 | under which to create the container console devices. Note that LXC | |
1106 | will move any bind-mounts or device nodes for /dev/console into | |
1107 | this directory. | |
1108 | --> | |
dc421f3a | 1109 | コンテナのコンソールデバイスを作成するための <filename>/dev</filename> 以下のディレクトリを指定します。 |
7a534f67 KY |
1110 | LXC は /dev/console に対する bind mount や /dev/console デバイスノードをこのディレクトリ以下に移動することに注意が必要です。 |
1111 | </para> | |
50a8555e KY |
1112 | </listitem> |
1113 | </varlistentry> | |
fb261f53 KY |
1114 | </variablelist> |
1115 | </refsect2> | |
1116 | ||
1117 | <refsect2> | |
1118 | <title><!-- /dev directory -->/dev ディレクトリ</title> | |
1119 | <para> | |
1120 | <!-- | |
50a8555e KY |
1121 | By default, lxc creates a few symbolic links (fd,stdin,stdout,stderr) |
1122 | in the container's <filename>/dev</filename> directory but does not | |
1123 | automatically create device node entries. This allows the container's | |
1124 | <filename>/dev</filename> to be set up as needed in the container | |
1125 | rootfs. If lxc.autodev is set to 1, then after mounting the container's | |
1126 | rootfs LXC will mount a fresh tmpfs under <filename>/dev</filename> | |
1127 | (limited to 500k) and fill in a minimal set of initial devices. | |
fb261f53 KY |
1128 | This is generally required when starting a container containing |
1129 | a "systemd" based "init" but may be optional at other times. Additional | |
1130 | devices in the containers /dev directory may be created through the | |
1131 | use of the <option>lxc.hook.autodev</option> hook. | |
1132 | --> | |
dc421f3a KY |
1133 | デフォルトでは、lxc はコンテナの <filename>/dev</filename> 以下に fd, stdin, stdout, stderr のシンボリックリンクを作成しますが、自動的にはデバイスノードのエントリは作成しません。 |
1134 | これは、コンテナの rootfs で必要な設定を行えるようにするものです。 | |
c35d2909 | 1135 | lxc.autodev が 1 に設定されている場合、コンテナの rootfs をマウントした後、LXC は新しい tmpfs を <filename>/dev</filename> 以下にマウントします (500k 制限の)。 |
dc421f3a KY |
1136 | そして初期デバイスの最小限のセットを作成します。 |
1137 | これは、"systemd" ベースの "init" 環境のコンテナを起動する時に通常必要ですが、他の環境の場合はオプショナルなものです。 | |
1138 | コンテナの /dev ディレクトリ内の追加デバイスは <option>lxc.hook.autodev</option> フックを使用して作成されます。 | |
fb261f53 KY |
1139 | </para> |
1140 | <variablelist> | |
50a8555e KY |
1141 | <varlistentry> |
1142 | <term> | |
1143 | <option>lxc.autodev</option> | |
1144 | </term> | |
1145 | <listitem> | |
1146 | <para> | |
fb261f53 | 1147 | <!-- |
a9516fe5 KY |
1148 | Set this to 0 to stop LXC from mounting and populating a minimal |
1149 | <filename>/dev</filename> when starting the container. | |
fb261f53 | 1150 | --> |
a9516fe5 | 1151 | コンテナの起動時に LXC が /dev をマウントして最小限の /dev を作成するのを止めるには、この値を 0 に設定してください。 |
50a8555e KY |
1152 | </para> |
1153 | </listitem> | |
1154 | </varlistentry> | |
fb261f53 KY |
1155 | </variablelist> |
1156 | </refsect2> | |
1157 | ||
fb261f53 KY |
1158 | <refsect2> |
1159 | <title><!-- Mount points -->マウントポイント</title> | |
1160 | <para> | |
1161 | <!-- | |
50a8555e KY |
1162 | The mount points section specifies the different places to be |
1163 | mounted. These mount points will be private to the container | |
1164 | and won't be visible by the processes running outside of the | |
1165 | container. This is useful to mount /etc, /var or /home for | |
1166 | examples. | |
fb261f53 | 1167 | --> |
dc421f3a KY |
1168 | マウントポイントセクションは、マウントするための区別された場所を指定します。 |
1169 | これらのマウントポイントは、コンテナだけに見え、コンテナ外で実行されるプロセスから見えることはありません。 | |
1170 | 例えば、/etc や /var や /home をマウントするときに役に立つでしょう。 | |
fb261f53 | 1171 | </para> |
2c79e91b | 1172 | <para> |
50a8555e KY |
1173 | <!-- |
1174 | NOTE - LXC will generally ensure that mount targets and relative | |
1175 | bind-mount sources are properly confined under the container | |
1176 | root, to avoid attacks involving over-mounting host directories | |
1177 | and files. (Symbolic links in absolute mount sources are ignored) | |
1178 | However, if the container configuration first mounts a directory which | |
1179 | is under the control of the container user, such as /home/joe, into | |
2c79e91b KY |
1180 | the container at some <filename>path</filename>, and then mounts |
1181 | under <filename>path</filename>, then a TOCTTOU attack would be | |
1182 | possible where the container user modifies a symbolic link under | |
1183 | his home directory at just the right time. | |
50a8555e KY |
1184 | --> |
1185 | 注意: 通常 LXC は、マウント対象と相対パス指定のバインドマウントを、適切にコンテナルート以下に閉じ込めます。 | |
1186 | これは、ホストのディレクトリやファイルに対して重ね合わせを行うようなマウントによる攻撃を防ぎます。(絶対パス指定のマウントソース中の各パスがシンボリックリンクである場合は無視されます。) | |
1187 | しかし、もしコンテナの設定が最初に、/home/joe のようなコンテナユーザのコントロール配下にあるディレクトリを、コンテナ中のある <filename>path</filename> にマウントし、その後 <filename>path</filename> 以下でマウントが行われるような場合、コンテナユーザがタイミングを見計らって自身のホームディレクトリ以下でシンボリックリンクを操作するような TOCTTOU 攻撃が成立する可能性があります。 | |
2c79e91b | 1188 | </para> |
fb261f53 | 1189 | <variablelist> |
50a8555e KY |
1190 | <varlistentry> |
1191 | <term> | |
e71b47b2 | 1192 | <option>lxc.mount.fstab</option> |
50a8555e KY |
1193 | </term> |
1194 | <listitem> | |
1195 | <para> | |
1196 | <!-- | |
1197 | specify a file location in | |
1198 | the <filename>fstab</filename> format, containing the | |
1199 | mount information. The mount target location can and in | |
1200 | most cases should be a relative path, which will become | |
1201 | relative to the mounted container root. For instance, | |
e053b31e KY |
1202 | --> |
1203 | マウント情報の書かれた <filename>fstab</filename> フォーマットで書かれたファイルの場所を指定します。 | |
1204 | マウントする場所は相対バスで書くことができます。そして、ほとんどの場合にコンテナの root からの相対パスとなるはずです。例えば、以下のように書きます。 | |
50a8555e | 1205 | </para> |
2513f519 KY |
1206 | <programlisting> |
1207 | proc proc proc nodev,noexec,nosuid 0 0 | |
1208 | </programlisting> | |
50a8555e | 1209 | <para> |
e053b31e | 1210 | <!-- |
50a8555e KY |
1211 | Will mount a proc filesystem under the container's /proc, |
1212 | regardless of where the root filesystem comes from. This | |
1213 | is resilient to block device backed filesystems as well as | |
1214 | container cloning. | |
e053b31e | 1215 | --> |
2513f519 | 1216 | この例は、root ファイルシステムがどこにあっても、コンテナの /proc 以下に proc ファイルシステムをマウントします。これは、ブロックデバイスがバックエンドのファイルシステムだけでなく、コンテナのクローンにも柔軟に対応できます。 |
50a8555e KY |
1217 | </para> |
1218 | <para> | |
e053b31e | 1219 | <!-- |
50a8555e KY |
1220 | Note that when mounting a filesystem from an |
1221 | image file or block device the third field (fs_vfstype) | |
1222 | cannot be auto as with | |
fb261f53 | 1223 | <citerefentry> |
50a8555e | 1224 | <refentrytitle>mount</refentrytitle> |
fb261f53 KY |
1225 | <manvolnum>8</manvolnum> |
1226 | </citerefentry> | |
1227 | but must be explicitly specified. | |
1228 | --> | |
dc421f3a | 1229 | ファイルシステムがイメージファイルやブロックデバイスからマウントされている場合、3 つ目のフィールド (fs_vfstype) は |
fb261f53 | 1230 | <citerefentry> |
50a8555e | 1231 | <refentrytitle>mount</refentrytitle> |
fb261f53 KY |
1232 | <manvolnum>8</manvolnum> |
1233 | </citerefentry> | |
dc421f3a | 1234 | のように auto を指定することはできず、明確に指定しなければいけません。 |
50a8555e KY |
1235 | </para> |
1236 | </listitem> | |
1237 | </varlistentry> | |
fb261f53 | 1238 | |
50a8555e KY |
1239 | <varlistentry> |
1240 | <term> | |
1241 | <option>lxc.mount.entry</option> | |
1242 | </term> | |
1243 | <listitem> | |
1244 | <para> | |
fb261f53 | 1245 | <!-- |
50a8555e KY |
1246 | specify a mount point corresponding to a line in the |
1247 | fstab format. | |
fb261f53 | 1248 | --> |
dc421f3a | 1249 | fstab フォーマットの一行と同じフォーマットのマウントポイントの指定をします。 |
b332333b KY |
1250 | |
1251 | <!-- | |
1252 | Moreover lxc add two options to mount. | |
1253 | <option>optional</option> don't fail if mount does not work. | |
1254 | <option>create=dir</option> or <option>create=file</option> | |
1255 | to create dir (or file) when the point will be mounted. | |
1256 | --> | |
1257 | fstab フォーマットに加えて、LXC ではマウントに対して独自の 2 つのオプションが使えます。 | |
1258 | <option>optional</option> は、マウントが失敗しても失敗を返さずに無視します。 | |
1259 | <option>create=dir</option> と <option>create=file</option> は、マウントポイントをマウントする際にディレクトリもしくはファイルを作成します。 | |
50a8555e KY |
1260 | </para> |
1261 | </listitem> | |
1262 | </varlistentry> | |
fb261f53 | 1263 | |
50a8555e KY |
1264 | <varlistentry> |
1265 | <term> | |
1266 | <option>lxc.mount.auto</option> | |
1267 | </term> | |
1268 | <listitem> | |
1269 | <para> | |
fb261f53 | 1270 | <!-- |
50a8555e KY |
1271 | specify which standard kernel file systems should be |
1272 | automatically mounted. This may dramatically simplify | |
1273 | the configuration. The file systems are: | |
fb261f53 | 1274 | --> |
dc421f3a KY |
1275 | 標準のカーネルファイルシステムで自動的にマウントするものを指定します。 |
1276 | これは劇的に設定を容易にする可能性があります。 | |
50a8555e KY |
1277 | </para> |
1278 | <itemizedlist> | |
1279 | <listitem> | |
fb261f53 | 1280 | <!-- |
50a8555e KY |
1281 | <para> |
1282 | <option>proc:mixed</option> (or <option>proc</option>): | |
1283 | mount <filename>/proc</filename> as read-write, but | |
1284 | remount <filename>/proc/sys</filename> and | |
1285 | <filename>/proc/sysrq-trigger</filename> read-only | |
1286 | for security / container isolation purposes. | |
1287 | </para> | |
fb261f53 KY |
1288 | --> |
1289 | <para> | |
1290 | <option>proc:mixed</option> (or <option>proc</option>): | |
dc421f3a KY |
1291 | <filename>/proc</filename> を読み書き可能でマウントします。 |
1292 | ただし、<filename>/proc/sys</filename> と <filename>/proc/sysrq-trigger</filename> は、セキュリティとコンテナの隔離の目的でリードオンリーで再マウントされます。 | |
fb261f53 | 1293 | </para> |
50a8555e KY |
1294 | </listitem> |
1295 | <listitem> | |
fb261f53 | 1296 | <!-- |
50a8555e KY |
1297 | <para> |
1298 | <option>proc:rw</option>: mount | |
1299 | <filename>/proc</filename> as read-write | |
1300 | </para> | |
fb261f53 KY |
1301 | --> |
1302 | <para> | |
50a8555e | 1303 | <option>proc:rw</option>: |
dc421f3a | 1304 | <filename>/proc</filename> を読み書き可能でマウントします。 |
fb261f53 | 1305 | </para> |
50a8555e KY |
1306 | </listitem> |
1307 | <listitem> | |
1308 | <!-- | |
dd93ef87 KY |
1309 | <para> |
1310 | <option>sys:mixed</option> (or <option>sys</option>): | |
1311 | mount <filename>/sys</filename> as read-only but with | |
1312 | /sys/devices/virtual/net writable. | |
1313 | </para> | |
50a8555e KY |
1314 | --> |
1315 | <para> | |
1316 | <option>sys:mixed</option> (or <option>sys</option>): | |
1317 | /sys/devices/virtual/net のみ書き込み可能で、その他の <filename>/sys</filename> はリードオンリーでマウントします。 | |
1318 | </para> | |
dd93ef87 | 1319 | </listitem> |
50a8555e | 1320 | <listitem> |
fb261f53 | 1321 | <!-- |
50a8555e KY |
1322 | <para> |
1323 | <option>sys:ro</option> | |
1324 | mount <filename>/sys</filename> as read-only | |
1325 | for security / container isolation purposes. | |
1326 | </para> | |
fb261f53 KY |
1327 | --> |
1328 | <para> | |
dd93ef87 | 1329 | <option>sys:ro</option>: |
dc421f3a | 1330 | <filename>/sys</filename> を、セキュリティとコンテナの隔離の目的でリードオンリーでマウントします。 |
fb261f53 | 1331 | </para> |
50a8555e KY |
1332 | </listitem> |
1333 | <listitem> | |
fb261f53 | 1334 | <!-- |
50a8555e KY |
1335 | <para> |
1336 | <option>sys:rw</option>: mount | |
1337 | <filename>/sys</filename> as read-write | |
1338 | </para> | |
fb261f53 KY |
1339 | --> |
1340 | <para> | |
50a8555e | 1341 | <option>sys:rw</option>: |
dc421f3a | 1342 | <filename>/sys</filename> を読み書き可能でマウントします。 |
fb261f53 | 1343 | </para> |
50a8555e KY |
1344 | </listitem> |
1345 | <listitem> | |
fb261f53 | 1346 | <!-- |
50a8555e KY |
1347 | <para> |
1348 | <option>cgroup:mixed</option>: | |
1349 | mount a tmpfs to <filename>/sys/fs/cgroup</filename>, | |
1350 | create directories for all hierarchies to which | |
1351 | the container is added, create subdirectories | |
1352 | there with the name of the cgroup, and bind-mount | |
1353 | the container's own cgroup into that directory. | |
1354 | The container will be able to write to its own | |
1355 | cgroup directory, but not the parents, since they | |
1356 | will be remounted read-only | |
1357 | </para> | |
fb261f53 KY |
1358 | --> |
1359 | <para> | |
50a8555e | 1360 | <option>cgroup:mixed</option>: |
dc421f3a KY |
1361 | <filename>/sys/fs/cgroup</filename> を tmpfs でマウントし、そのコンテナの追加が行われた全ての階層構造に対するディレクトリを作製し、その cgroup の名前でその中にサブディレクトリを作製し、そのコンテナ自身の cgroup をそのディレクトリにバインドマウントします。 |
1362 | コンテナは自身の cgroup ディレクトリに書き込みが可能ですが、親ディレクトリはリードオンリーで再マウントされているため書き込めません。 | |
fb261f53 | 1363 | </para> |
50a8555e KY |
1364 | </listitem> |
1365 | <listitem> | |
fb261f53 | 1366 | <!-- |
50a8555e KY |
1367 | <para> |
1368 | <option>cgroup:ro</option>: similar to | |
1369 | <option>cgroup:mixed</option>, but everything will | |
1370 | be mounted read-only. | |
1371 | </para> | |
fb261f53 KY |
1372 | --> |
1373 | <para> | |
50a8555e | 1374 | <option>cgroup:ro</option>: |
dc421f3a | 1375 | <option>cgroup:mixed</option> と同様にマウントされますが、全てリードオンリーでマウントされます。 |
fb261f53 | 1376 | </para> |
50a8555e KY |
1377 | </listitem> |
1378 | <listitem> | |
fb261f53 | 1379 | <!-- |
50a8555e KY |
1380 | <para> |
1381 | <option>cgroup:rw</option>: similar to | |
1382 | <option>cgroup:mixed</option>, but everything will | |
1383 | be mounted read-write. Note that the paths leading | |
1384 | up to the container's own cgroup will be writable, | |
1385 | but will not be a cgroup filesystem but just part | |
1386 | of the tmpfs of <filename>/sys/fs/cgroup</filename> | |
1387 | </para> | |
fb261f53 KY |
1388 | --> |
1389 | <para> | |
50a8555e | 1390 | <option>cgroup:rw</option>: |
dc421f3a KY |
1391 | <option>cgroup:mixed</option> と同様にマウントされますが、全て読み書き可能でマウントされます。 |
1392 | コンテナ自身の cgroup に至るまでのパスも書き込み可能になることに注意が必要ですが、cgroup ファイルシステムにはならず、 | |
1393 | <filename>/sys/fs/cgroup</filename> の tmpfs の一部分になるでしょう。 | |
fb261f53 | 1394 | </para> |
50a8555e KY |
1395 | </listitem> |
1396 | <listitem> | |
1397 | <para> | |
aafea1f7 | 1398 | <!-- |
50a8555e KY |
1399 | <option>cgroup</option> (without specifier): |
1400 | defaults to <option>cgroup:rw</option> if the | |
1401 | container retains the CAP_SYS_ADMIN capability, | |
1402 | <option>cgroup:mixed</option> otherwise. | |
aafea1f7 | 1403 | --> |
50a8555e | 1404 | <option>cgroup</option> (マウントオプションなしの場合): |
aafea1f7 | 1405 | コンテナが CAP_SYS_ADMIN ケーパビリティを保持している場合、<option>cgroup:rw</option> となります。保持していない場合、<option>cgroup:mixed</option> となります。 |
50a8555e KY |
1406 | </para> |
1407 | </listitem> | |
1408 | <listitem> | |
fb261f53 | 1409 | <!-- |
50a8555e KY |
1410 | <para> |
1411 | <option>cgroup-full:mixed</option>: | |
1412 | mount a tmpfs to <filename>/sys/fs/cgroup</filename>, | |
1413 | create directories for all hierarchies to which | |
1414 | the container is added, bind-mount the hierarchies | |
1415 | from the host to the container and make everything | |
1416 | read-only except the container's own cgroup. Note | |
1417 | that compared to <option>cgroup</option>, where | |
1418 | all paths leading up to the container's own cgroup | |
1419 | are just simple directories in the underlying | |
1420 | tmpfs, here | |
1421 | <filename>/sys/fs/cgroup/$hierarchy</filename> | |
1422 | will contain the host's full cgroup hierarchy, | |
1423 | albeit read-only outside the container's own cgroup. | |
1424 | This may leak quite a bit of information into the | |
1425 | container. | |
1426 | </para> | |
fb261f53 KY |
1427 | --> |
1428 | <para> | |
50a8555e | 1429 | <option>cgroup-full:mixed</option>: |
dc421f3a KY |
1430 | <filename>/sys/fs/cgroup</filename> を tmpfs でマウントし、そのコンテナの追加が行われた全ての階層構造に対するディレクトリを作製し、ホストからコンテナまでの階層構造を全てバインドマウントし、コンテナ自身の cgroup を除いてリードオンリーにします。 |
1431 | <option>cgroup</option> と比べると、コンテナ自身の cgroup に至るまでの全てのパスが tmpfs の下層のシンプルなディレクトリとなり、コンテナ自身の cgroup の外ではリードオンリーになりますが、<filename>/sys/fs/cgroup/$hierarchy</filename> はホストの全ての cgroup 階層構造を含みます。 | |
1432 | これにより、コンテナにはかなりの情報が漏洩します。 | |
fb261f53 | 1433 | </para> |
50a8555e KY |
1434 | </listitem> |
1435 | <listitem> | |
fb261f53 | 1436 | <!-- |
50a8555e KY |
1437 | <para> |
1438 | <option>cgroup-full:ro</option>: similar to | |
1439 | <option>cgroup-full:mixed</option>, but everything | |
1440 | will be mounted read-only. | |
1441 | </para> | |
fb261f53 KY |
1442 | --> |
1443 | <para> | |
50a8555e | 1444 | <option>cgroup-full:ro</option>: |
dc421f3a | 1445 | <option>cgroup-full:mixed</option> と同様にマウントされますが、全てリードオンリーでマウントされます。 |
fb261f53 | 1446 | </para> |
50a8555e KY |
1447 | </listitem> |
1448 | <listitem> | |
fb261f53 | 1449 | <!-- |
50a8555e KY |
1450 | <para> |
1451 | <option>cgroup-full:rw</option>: similar to | |
1452 | <option>cgroup-full:mixed</option>, but everything | |
1453 | will be mounted read-write. Note that in this case, | |
1454 | the container may escape its own cgroup. (Note also | |
1455 | that if the container has CAP_SYS_ADMIN support | |
1456 | and can mount the cgroup filesystem itself, it may | |
1457 | do so anyway.) | |
1458 | </para> | |
fb261f53 KY |
1459 | --> |
1460 | <para> | |
50a8555e KY |
1461 | <option>cgroup-full:rw</option>: |
1462 | <option>cgroup-full:mixed</option>と同様にマウントされますが、全て読み書き可能でマウントされます。 | |
dc421f3a | 1463 | この場合、コンテナは自身の cgroup から脱出する可能性があることに注意してください (コンテナが CAP_SYS_ADMIN を持ち、自身で cgroup ファイルシステムをマウント可能なら、いずれにせよそのようにするかもしれないことにも注意してください)。 |
fb261f53 | 1464 | </para> |
50a8555e KY |
1465 | </listitem> |
1466 | <listitem> | |
1467 | <para> | |
aafea1f7 | 1468 | <!-- |
50a8555e KY |
1469 | <option>cgroup-full</option> (without specifier): |
1470 | defaults to <option>cgroup-full:rw</option> if the | |
1471 | container retains the CAP_SYS_ADMIN capability, | |
1472 | <option>cgroup-full:mixed</option> otherwise. | |
aafea1f7 | 1473 | --> |
50a8555e | 1474 | <option>cgroup-full</option> (マウントオプションなしの場合): |
aafea1f7 | 1475 | コンテナが CAP_SYS_ADMIN ケーパビリティを保持している場合、<option>cgroup-full:rw</option> となります。保持していない場合、<option>cgroup-full:mixed</option> となります。 |
50a8555e KY |
1476 | </para> |
1477 | </listitem> | |
1478 | </itemizedlist> | |
1479 | <para> | |
1480 | <!-- | |
1481 | If cgroup namespaces are enabled, then any <option>cgroup</option> | |
1482 | auto-mounting request will be ignored, since the container can | |
1483 | mount the filesystems itself, and automounting can confuse the | |
1484 | container init. | |
1485 | --> | |
1486 | cgroup 名前空間が有効の場合、<option>cgroup</option> の自動マウントの指定はどれも無視されます。これは、コンテナが自身でファイルシステムをマウントするため、自動マウントがコンテナの init を混乱させる可能性があるためです。 | |
1487 | </para> | |
1488 | <para> | |
1489 | <!-- | |
1490 | Note that if automatic mounting of the cgroup filesystem | |
1491 | is enabled, the tmpfs under | |
1492 | <filename>/sys/fs/cgroup</filename> will always be | |
1493 | mounted read-write (but for the <option>:mixed</option> | |
1494 | and <option>:ro</option> cases, the individual | |
1495 | hierarchies, | |
1496 | <filename>/sys/fs/cgroup/$hierarchy</filename>, will be | |
1497 | read-only). This is in order to work around a quirk in | |
1498 | Ubuntu's | |
1499 | <citerefentry> | |
1500 | <refentrytitle>mountall</refentrytitle> | |
cf5f3128 KY |
1501 | <manvolnum>8</manvolnum> |
1502 | </citerefentry> | |
50a8555e KY |
1503 | command that will cause containers to wait for user |
1504 | input at boot if | |
1505 | <filename>/sys/fs/cgroup</filename> is mounted read-only | |
1506 | and the container can't remount it read-write due to a | |
1507 | lack of CAP_SYS_ADMIN. | |
cf5f3128 KY |
1508 | --> |
1509 | cgroup ファイルシステムの自動マウントが有効の場合、<filename>/sys/fs/cgroup</filename> 以下の tmpfs は常に読み書き可能でマウントされることに注意が必要です (しかし <option>:mixed</option> と <option>:ro</option> の場合は、個々の階層の <filename>/sys/fs/cgroup/$hierarchy</filename> は読み込み専用となるでしょう)。これは Ubuntu の | |
1510 | <citerefentry> | |
50a8555e | 1511 | <refentrytitle>mountall</refentrytitle> |
cf5f3128 KY |
1512 | <manvolnum>8</manvolnum> |
1513 | </citerefentry> | |
1514 | コマンドの特異な動きに対処するためのものです。特異な動きとは、<filename>/sys/fs/cgroup</filename> が読み込み専用でマウントされた状態で、コンテナが CAP_SYS_ADMIN を持たない場合、/sys/fs/cgroup を読み書き可能で再マウントしようとしてできないため、コンテナのブート時にユーザからの入力を待ってしまうというものです。 | |
50a8555e KY |
1515 | </para> |
1516 | <para> | |
fb261f53 | 1517 | <!-- |
50a8555e | 1518 | Examples: |
fb261f53 KY |
1519 | --> |
1520 | 例: | |
50a8555e KY |
1521 | </para> |
1522 | <programlisting> | |
1523 | lxc.mount.auto = proc sys cgroup | |
1524 | lxc.mount.auto = proc:rw sys:rw cgroup-full:rw | |
1525 | </programlisting> | |
1526 | </listitem> | |
1527 | </varlistentry> | |
fb261f53 KY |
1528 | |
1529 | </variablelist> | |
1530 | </refsect2> | |
1531 | ||
1532 | <refsect2> | |
1533 | <title><!-- Root file system -->ルートファイルシステム</title> | |
1534 | <para> | |
1535 | <!-- | |
50a8555e KY |
1536 | The root file system of the container can be different than that |
1537 | of the host system. | |
fb261f53 | 1538 | --> |
dc421f3a | 1539 | コンテナのルートファイルシステムは、ホストのルートファイルシステムと異なるようにすることも可能です。 |
fb261f53 KY |
1540 | </para> |
1541 | <variablelist> | |
50a8555e KY |
1542 | <varlistentry> |
1543 | <term> | |
a64f3157 | 1544 | <option>lxc.rootfs.path</option> |
50a8555e KY |
1545 | </term> |
1546 | <listitem> | |
1547 | <para> | |
1548 | <!-- | |
1549 | specify the root file system for the container. It can | |
1550 | be an image file, a directory or a block device. If not | |
1551 | specified, the container shares its root file system | |
1552 | with the host. | |
fb261f53 | 1553 | --> |
8b3374e5 | 1554 | コンテナのルートファイルシステムを指定します。 |
dc421f3a KY |
1555 | この値はイメージファイル、ディレクトリ、ブロックデバイスのどれかを取ることができます。 |
1556 | もし指定されない場合、コンテナはホストとルートファイルシステムを共有します。 | |
50a8555e KY |
1557 | </para> |
1558 | <para> | |
a4dbc45f KY |
1559 | <!-- |
1560 | For directory or simple block-device backed containers, | |
1561 | a pathname can be used. If the rootfs is backed by a nbd | |
1562 | device, then <filename>nbd:file:1</filename> specifies that | |
1563 | <filename>file</filename> should be attached to a nbd device, | |
1564 | and partition 1 should be mounted as the rootfs. | |
1565 | <filename>nbd:file</filename> specifies that the nbd device | |
1566 | itself should be mounted. <filename>overlayfs:/lower:/upper</filename> | |
1567 | specifies that the rootfs should be an overlay with <filename>/upper</filename> | |
1568 | being mounted read-write over a read-only mount of <filename>/lower</filename>. | |
1569 | <filename>aufs:/lower:/upper</filename> does the same using aufs in place | |
ddf81220 KY |
1570 | of overlayfs. For both <filename>overlayfs</filename> and |
1571 | <filename>aufs</filename> multiple <filename>/lower</filename> | |
1572 | directories can be specified. <filename>loop:/file</filename> tells lxc to attach | |
a4dbc45f KY |
1573 | <filename>/file</filename> to a loop device and mount the loop device. |
1574 | --> | |
1575 | ディレクトリ、単純なブロックデバイスのバックエンドを持つコンテナの場合、パス名を使うことができます。 | |
1576 | もし rootfs が nbd デバイスの場合、<filename>nbd:file:1</filename> という指定は <filename>file</filename> を nbd デバイスとして使用し、その 1 番目のパーティションが rootfs としてマウントされます。 | |
1577 | <filename>nbd:file</filename> という指定は、nbd デバイス自身をマウントします。 | |
1578 | <filename>overlayfs:/lower:/upper</filename> という指定は、rootfs は <filename>/lower</filename> という読み込み専用でマウントされるディレクトリの上に、<filename>/upper</filename> というディレクトリを読み書き可能で重ね合わせてマウントします。 | |
ddf81220 | 1579 | <filename>aufs:/lower:/upper</filename> は overlayfs で指定している部分を aufs と指定すれば同じことになります。<filename>overlayfs</filename> と <filename>aufs</filename> は両方とも、複数の <filename>/lower</filename> ディレクトリを指定できます。 |
a4dbc45f | 1580 | <filename>loop:/file</filename> は <filename>/file</filename> を loop デバイスとして使用し、loop デバイスをマウントします。 |
50a8555e KY |
1581 | </para> |
1582 | </listitem> | |
1583 | </varlistentry> | |
1584 | ||
1585 | <varlistentry> | |
1586 | <term> | |
1587 | <option>lxc.rootfs.mount</option> | |
1588 | </term> | |
1589 | <listitem> | |
1590 | <para> | |
1591 | <!-- | |
a64f3157 | 1592 | where to recursively bind <option>lxc.rootfs.path</option> |
50a8555e KY |
1593 | before pivoting. This is to ensure success of the |
1594 | <citerefentry> | |
1595 | <refentrytitle><command>pivot_root</command></refentrytitle> | |
1596 | <manvolnum>8</manvolnum> | |
1597 | </citerefentry> | |
1598 | syscall. Any directory suffices, the default should | |
1599 | generally work. | |
fb261f53 | 1600 | --> |
a64f3157 | 1601 | root ファイルシステムの変更の前に、<option>lxc.rootfs.path</option> を再帰的にどこにバインドするのかを指定します。これは |
50a8555e KY |
1602 | <citerefentry> |
1603 | <refentrytitle><command>pivot_root</command></refentrytitle> | |
1604 | <manvolnum>8</manvolnum> | |
1605 | </citerefentry> | |
dc421f3a KY |
1606 | システムコールが確実に成功する事を保証します。 |
1607 | どんなディレクトリでも良く、デフォルトでも通常は動くはずです。 | |
50a8555e KY |
1608 | </para> |
1609 | </listitem> | |
1610 | </varlistentry> | |
fb261f53 | 1611 | |
50a8555e KY |
1612 | <varlistentry> |
1613 | <term> | |
1614 | <option>lxc.rootfs.options</option> | |
1615 | </term> | |
1616 | <listitem> | |
1617 | <para> | |
b4c66de1 | 1618 | <!-- |
50a8555e | 1619 | extra mount options to use when mounting the rootfs. |
b4c66de1 | 1620 | --> |
dc421f3a | 1621 | rootfs をマウントするときに追加したいマウントオプション。 |
50a8555e KY |
1622 | </para> |
1623 | </listitem> | |
1624 | </varlistentry> | |
b4c66de1 | 1625 | |
fb261f53 KY |
1626 | </variablelist> |
1627 | </refsect2> | |
1628 | ||
1629 | <refsect2> | |
1630 | <title>Control group</title> | |
1631 | <para> | |
1632 | <!-- | |
50a8555e KY |
1633 | The control group section contains the configuration for the |
1634 | different subsystem. <command>lxc</command> does not check the | |
1635 | correctness of the subsystem name. This has the disadvantage | |
1636 | of not detecting configuration errors until the container is | |
1637 | started, but has the advantage of permitting any future | |
1638 | subsystem. | |
fb261f53 | 1639 | --> |
dc421f3a KY |
1640 | CONTROL GROUP セクションは、(lxc とは) 別のサブシステムの設定を含みます。 |
1641 | <command>lxc</command> は、このサブシステム名の正しさはチェックしません。 | |
1642 | 実行時のエラーを検出するのに不便ですが、別の将来のサブシステムをサポート出来るという有利な点もあります。 | |
fb261f53 KY |
1643 | </para> |
1644 | <variablelist> | |
50a8555e KY |
1645 | <varlistentry> |
1646 | <term> | |
1647 | <option>lxc.cgroup.[subsystem name]</option> | |
1648 | </term> | |
1649 | <listitem> | |
1650 | <para> | |
1651 | <!-- | |
1652 | specify the control group value to be set. The | |
1653 | subsystem name is the literal name of the control group | |
1654 | subsystem. The permitted names and the syntax of their | |
1655 | values is not dictated by LXC, instead it depends on the | |
1656 | features of the Linux kernel running at the time the | |
1657 | container is started, | |
1658 | eg. <option>lxc.cgroup.cpuset.cpus</option> | |
fb261f53 | 1659 | --> |
dc421f3a KY |
1660 | 設定する control group の値を指定します。 |
1661 | サブシステム名は、control group のそのままの名前です。 | |
1662 | 許される名前や値の書式は LXC が指示することはなく、コンテナが実行された時に実行されている Linux カーネルの機能に依存します。 | |
fb261f53 | 1663 | 例えば <option>lxc.cgroup.cpuset.cpus</option> |
50a8555e KY |
1664 | </para> |
1665 | </listitem> | |
1666 | </varlistentry> | |
78be8d75 KY |
1667 | <varlistentry> |
1668 | <term> | |
1669 | <option>lxc.cgroup.dir</option> | |
1670 | </term> | |
1671 | <listitem> | |
1672 | <para> | |
1673 | <!-- | |
1674 | specify a directory or path in which the container's cgroup will | |
1675 | be created. For example, setting | |
1676 | <option>lxc.cgroup.dir = my-cgroup/first</option> for a container | |
1677 | named "c1" will create the container's cgroup as a sub-cgroup of | |
1678 | "my-cgroup". For example, if the user's current cgroup "my-user" | |
1679 | is located in the root cgroup of the cpuset controllerin in a | |
1680 | cgroup v1 hierarchy this would create the cgroup | |
1681 | "/sys/fs/cgroup/cpuset/my-user/my-cgroup/first/c1" for the | |
1682 | container. Any missing cgroups will be created by LXC. This | |
1683 | presupposes that the user has write access to its current cgroup. | |
1684 | --> | |
1685 | コンテナの cgroup を作成するパスやディレクトリを指定します。 | |
1686 | 例えば、"c1" という名前のコンテナで <option>lxc.cgroup.dir = my-cgroup/first</option> のように設定すると、"my-cgroup" のサブ cgroup のようにコンテナの cgroup を作成します。 | |
1687 | 例えば、ユーザのカレントの cgroup である "my-user" が cgroup v1 階層にある cpuset コントローラの root cgroup 内に存在する場合、この設定は "/sys/fs/cgroup/cpuset/my-user/my-cgroup/first/c1" という cgroup をこのコンテナ向けに作成します。 | |
1688 | 存在しない cgroup は LXC が作成しますが、ユーザがカレントの cgroup に書き込み権を持っていることが前提となります。 | |
1689 | </para> | |
1690 | </listitem> | |
1691 | </varlistentry> | |
fb261f53 KY |
1692 | </variablelist> |
1693 | </refsect2> | |
1694 | ||
1695 | <refsect2> | |
1696 | <title><!-- Capabilities -->ケーパビリティ</title> | |
1697 | <para> | |
1698 | <!-- | |
50a8555e KY |
1699 | The capabilities can be dropped in the container if this one |
1700 | is run as root. | |
fb261f53 | 1701 | --> |
dc421f3a | 1702 | コンテナが root 権限で実行されていても、コンテナ内ではケーパビリティ (capabilities) を削除する事は可能です。 |
fb261f53 KY |
1703 | </para> |
1704 | <variablelist> | |
50a8555e KY |
1705 | <varlistentry> |
1706 | <term> | |
1707 | <option>lxc.cap.drop</option> | |
1708 | </term> | |
1709 | <listitem> | |
1710 | <para> | |
1711 | <!-- | |
1712 | Specify the capability to be dropped in the container. A | |
1713 | single line defining several capabilities with a space | |
1714 | separation is allowed. The format is the lower case of | |
1715 | the capability definition without the "CAP_" prefix, | |
1716 | eg. CAP_SYS_MODULE should be specified as | |
1717 | sys_module. See | |
1718 | <citerefentry> | |
1719 | <refentrytitle><command>capabilities</command></refentrytitle> | |
1720 | <manvolnum>7</manvolnum> | |
1721 | </citerefentry>, | |
9c3f2966 KY |
1722 | If used with no value, lxc will clear any drop capabilities |
1723 | specified up to this point. | |
fb261f53 | 1724 | --> |
dc421f3a KY |
1725 | コンテナ内で削除するケーパビリティ (capability) を指定します。 |
1726 | 一行でスペース区切りで複数のケーパビリティを指定することも可能です。 | |
1727 | 指定は、"CAP_" というプレフィックスなしで、小文字でケーパビリティを指定します。 | |
1728 | 例えば、CAP_SYS_MODULE というケーパビリティは sys_module と指定する必要があります。 | |
1729 | 詳しくは以下を参照してください。 | |
50a8555e KY |
1730 | <citerefentry> |
1731 | <refentrytitle><command>capabilities</command></refentrytitle> | |
1732 | <manvolnum>7</manvolnum> | |
1733 | </citerefentry> | |
1734 | この設定を、値を指定しない状態で使った場合、それ以前に指定された削除対象のケーパビリティの指定をすべてクリアします (lxc.cap.drop に何も指定しない状態になります)。 | |
1735 | </para> | |
1736 | </listitem> | |
1737 | </varlistentry> | |
1738 | <varlistentry> | |
1739 | <term> | |
1740 | <option>lxc.cap.keep</option> | |
1741 | </term> | |
1742 | <listitem> | |
1743 | <para> | |
1744 | <!-- | |
1745 | Specify the capability to be kept in the container. All other | |
1746 | capabilities will be dropped. When a special value of "none" is | |
1747 | encountered, lxc will clear any keep capabilities specified up | |
1748 | to this point. A value of "none" alone can be used to drop all | |
1749 | capabilities. | |
fb261f53 | 1750 | --> |
f36062dc KY |
1751 | コンテナ内で維持するケーパビリティを指定します。指定した以外の全てのケーパビリティはドロップされます。 |
1752 | 特別な値 "none" が指定されている時点で、lxc はこの時点で保持することになっている全てのケーパビリティをクリアします。"none" を単独で使用するとすべてのケーパビリティを削除できます。 | |
50a8555e KY |
1753 | </para> |
1754 | </listitem> | |
1755 | </varlistentry> | |
fb261f53 KY |
1756 | </variablelist> |
1757 | </refsect2> | |
1758 | ||
615e68b2 KY |
1759 | <refsect2> |
1760 | <title>名前空間の継承 <!-- Namespace Inheritance --></title> | |
1761 | <para> | |
1762 | <!-- | |
1763 | A namespace can be inherited from another container or process. | |
1764 | --> | |
1765 | 他のコンテナやプロセスから名前空間を継承できます。 | |
1766 | </para> | |
1767 | <variablelist> | |
1768 | <varlistentry> | |
1769 | <term> | |
1770 | <option>lxc.namespace.[namespace identifier]</option> | |
1771 | </term> | |
1772 | <listitem> | |
1773 | <para> | |
1774 | <!-- | |
1775 | Specify a namespace to inherit from another container or process. | |
1776 | The <option>[namespace identifier]</option> suffix needs to be | |
1777 | replaced with one of the namespaces that appear in the | |
1778 | <filename>/proc/PID/ns</filename> directory. | |
1779 | --> | |
1780 | 他のコンテナやプロセスから継承する名前空間を指定します。<option>[namespace identifier]</option> には、<filename>/proc/PID/ns</filename> ディレクトリ内に現れる名前空間のひとつが入ります。 | |
1781 | </para> | |
1782 | ||
1783 | <para> | |
1784 | <!-- | |
1785 | To inherit the namespace from another process set the | |
1786 | <option>lxc.namespace.[namespace identifier]</option> to the PID of | |
1787 | the process, e.g. <option>lxc.namespace.net=42</option>. | |
1788 | --> | |
1789 | 他のプロセスから名前空間を継承するには、<option>lxc.namespace.[namespace identifier]</option> の値をプロセスの PID に設定します。例えば <option>lxc.namespace.net=42</option> のようになります。 | |
1790 | </para> | |
1791 | ||
1792 | <para> | |
1793 | <!-- | |
1794 | To inherit the namespace from another container set the | |
1795 | <option>lxc.namespace.[namespace identifier]</option> to the name of | |
1796 | the container, e.g. <option>lxc.namespace.pid=c3</option>. | |
1797 | --> | |
1798 | 他のコンテナから名前空間を継承するには、<option>lxc.namespace.[namespace identifier]</option> の値をコンテナ名に設定します。例えば <option>lxc.namespace.pid=c3</option> のようになります。 | |
1799 | </para> | |
1800 | ||
1801 | <para> | |
1802 | <!-- | |
1803 | To inherit the namespace from another container located in a | |
1804 | different path than the standard liblxc path set the | |
1805 | <option>lxc.namespace.[namespace identifier]</option> to the full | |
1806 | path to the container, e.g. | |
1807 | <option>lxc.namespace.user=/opt/c3</option>. | |
1808 | --> | |
1809 | 標準の liblxc のパスとは異なるコンテナパスに存在する他のコンテナから名前空間を継承するには、<option>lxc.namespace.[namespace identifier]</option> をそのコンテナのフルパスで指定します。例えば <option>lxc.namespace.user=/opt/c3</option> のようになります。 | |
1810 | </para> | |
1811 | ||
1812 | <para> | |
1813 | <!-- | |
1814 | In order to inherit namespaces the caller needs to have sufficient | |
1815 | privilege over the process or container. | |
1816 | --> | |
1817 | 名前空間を継承するためには、呼び出し元が継承元のプロセスまたはコンテナに対して十分な権限を持っている必要があります。 | |
1818 | </para> | |
1819 | ||
1820 | <para> | |
1821 | <!-- | |
1822 | Note that sharing pid namespaces between system containers will | |
1823 | likely not work with most init systems. | |
1824 | --> | |
1825 | システムコンテナ間での PID 名前空間の共有は、ほとんどの init システムではうまく動作しない可能性があることに注意が必要です。 | |
1826 | </para> | |
1827 | ||
1828 | <para> | |
1829 | <!-- | |
1830 | Note that if two processes are in different user namespaces and one | |
1831 | process wants to inherit the other's network namespace it usually | |
1832 | needs to inherit the user namespace as well. | |
1833 | --> | |
1834 | ふたつのプロセスが異なるユーザ名前空間に存在し、そのうちのひとつが他のネットワーク名前空間を継承したい場合、通常はユーザ名前空間も同様に継承する必要があることに注意が必要です。 | |
1835 | </para> | |
1836 | </listitem> | |
1837 | </varlistentry> | |
1838 | </variablelist> | |
1839 | </refsect2> | |
1840 | ||
e7267b53 KY |
1841 | <refsect2> |
1842 | <title>リソース制限 <!-- Resource limits --></title> | |
1843 | <para> | |
50a8555e | 1844 | <!-- |
e7267b53 KY |
1845 | The soft and hard resource limits for the container can be changed. |
1846 | Unprivileged containers can only lower them. Resources which are not | |
1847 | explicitly specified will be inherited. | |
50a8555e KY |
1848 | --> |
1849 | コンテナに対するソフトもしくはハードリミットを変更できます。非特権コンテナでは、制限を下げることしかできません。明示的に指定されていないリソースは継承されます。 | |
e7267b53 KY |
1850 | </para> |
1851 | <variablelist> | |
1852 | <varlistentry> | |
1853 | <term> | |
240d4b74 | 1854 | <option>lxc.prlimit.[limit name]</option> |
e7267b53 KY |
1855 | </term> |
1856 | <listitem> | |
1857 | <para> | |
1858 | <!-- | |
1859 | Specify the resource limit to be set. A limit is specified as two | |
1860 | colon separated values which are either numeric or the word | |
1861 | 'unlimited'. A single value can be used as a shortcut to set both | |
1862 | soft and hard limit to the same value. The permitted names the | |
1863 | "RLIMIT_" resource names in lowercase without the "RLIMIT_" | |
1864 | prefix, eg. RLIMIT_NOFILE should be specified as "nofile". See | |
1865 | <citerefentry> | |
1866 | <refentrytitle><command>setrlimit</command></refentrytitle> | |
1867 | <manvolnum>2</manvolnum> | |
1868 | </citerefentry>. | |
1869 | If used with no value, lxc will clear the resource limit | |
1870 | specified up to this point. A resource with no explicitly | |
1871 | configured limitation will be inherited from the process starting | |
1872 | up the container. | |
1873 | --> | |
1874 | 設定したいリソースと制限値を指定します。制限値はコロンで区切られた 2 つの値で指定します。値は数値もしくは 'unlimited' で指定します。ソフトもハードも同じ値を指定する場合は単一の値を指定できます。指定できる名前は、"RLIMIT_" 接頭辞がなく小文字で書かれた、"RLIMIT_" リソース名です。例えば、RLIMIT_NOFILE は "nofile" と指定します。詳しくは | |
1875 | <citerefentry> | |
1876 | <refentrytitle><command>setrlimit</command></refentrytitle> | |
1877 | <manvolnum>2</manvolnum> | |
1878 | </citerefentry> を参照してください。 | |
1879 | 値を指定せずに使用した場合、lxc はこの指定以前に設定されたリソース制限をクリアします。明示的に制限が設定されていないリソースについては、コンテナを起動したプロセスから継承します。 | |
1880 | </para> | |
1881 | </listitem> | |
1882 | </varlistentry> | |
1883 | </variablelist> | |
1884 | </refsect2> | |
1885 | ||
fb261f53 KY |
1886 | <refsect2> |
1887 | <title><!-- Apparmor profile -->Apparmor プロファイル</title> | |
1888 | <para> | |
1889 | <!-- | |
50a8555e KY |
1890 | If lxc was compiled and installed with apparmor support, and the host |
1891 | system has apparmor enabled, then the apparmor profile under which the | |
1892 | container should be run can be specified in the container | |
9d101b3d | 1893 | configuration. The default is <command>lxc-container-default-cgns</command> |
50a8555e KY |
1894 | if the host kernel is cgroup namespace aware, or |
1895 | <command>lxc-container-default</command> othewise. | |
fb261f53 | 1896 | --> |
dc421f3a | 1897 | lxc が apparmor サポートでコンパイルされ、インストールされている場合で、ホストで apparmor が有効な場合、コンテナが従って動くべき apparmor プロファイルは、コンテナの設定で指定することが可能です。 |
cd548c9d | 1898 | デフォルトは、ホストのカーネルで cgroup 名前空間が使える場合は <command>lxc-container-default-cgns</command>です。使えない場合は <command>lxc-container-default</command> です。 |
fb261f53 KY |
1899 | </para> |
1900 | <variablelist> | |
50a8555e KY |
1901 | <varlistentry> |
1902 | <term> | |
a1d5fdfd | 1903 | <option>lxc.apparmor.profile</option> |
50a8555e KY |
1904 | </term> |
1905 | <listitem> | |
1906 | <para> | |
fb261f53 | 1907 | <!-- |
50a8555e KY |
1908 | Specify the apparmor profile under which the container should |
1909 | be run. To specify that the container should be unconfined, | |
1910 | use | |
fb261f53 | 1911 | --> |
dc421f3a KY |
1912 | コンテナが従うべき apparmor プロファイルを指定します。 |
1913 | コンテナが apparmor による制限を受けないように設定するには、以下のように設定します。 | |
50a8555e | 1914 | </para> |
a1d5fdfd | 1915 | <programlisting>lxc.apparmor.profile = unconfined</programlisting> |
9d101b3d | 1916 | <para> |
50a8555e | 1917 | <!-- |
9d101b3d | 1918 | If the apparmor profile should remain unchanged (i.e. if you |
50a8555e KY |
1919 | are nesting containers and are already confined), then use |
1920 | --> | |
1921 | もし apparmor プロファイルが変更されないままでなくてはならない場合 (ネストしたコンテナである場合や、すでに confined されている場合) は以下のように設定します。 | |
9d101b3d | 1922 | </para> |
a1d5fdfd | 1923 | <programlisting>lxc.apparmor.profile = unchanged</programlisting> |
50a8555e KY |
1924 | </listitem> |
1925 | </varlistentry> | |
1926 | <varlistentry> | |
1927 | <term> | |
69e38e00 | 1928 | <option>lxc.apparmor.allow_incomplete</option> |
50a8555e KY |
1929 | </term> |
1930 | <listitem> | |
1931 | <para> | |
1932 | <!-- | |
1933 | Apparmor profiles are pathname based. Therefore many file | |
1934 | restrictions require mount restrictions to be effective against | |
1935 | a determined attacker. However, these mount restrictions are not | |
1936 | yet implemented in the upstream kernel. Without the mount | |
1937 | restrictions, the apparmor profiles still protect against accidental | |
1938 | damager. | |
edf3a692 KY |
1939 | --> |
1940 | apparmor プロファイルはパス名ベースですので、多数のファイルの制限を行う際、執念深い攻撃者に対して効果的であるためにはマウントの制限が必要です。 | |
1941 | しかし、これらのマウントの制限は upstream のカーネルではまだ実装されていません。マウントの制限なしでも、apparmor プロファイルによって予想外のダメージに対する保護が可能です。 | |
50a8555e KY |
1942 | </para> |
1943 | <para> | |
edf3a692 | 1944 | <!-- |
50a8555e KY |
1945 | If this flag is 0 (default), then the container will not be |
1946 | started if the kernel lacks the apparmor mount features, so that a | |
1947 | regression after a kernel upgrade will be detected. To start the | |
1948 | container under partial apparmor protection, set this flag to 1. | |
edf3a692 KY |
1949 | --> |
1950 | このフラグが 0 の場合 (デフォルト)、カーネルが apparmor のマウント機能をサポートしていない場合にコンテナが起動しません。これはカーネルを更新した後に機能が退行したことが検出できるようにするためです。 | |
1951 | 不完全な apparmor の保護の下でコンテナを起動するためには、このフラグを 1 に設定してください。 | |
50a8555e KY |
1952 | </para> |
1953 | </listitem> | |
1954 | </varlistentry> | |
fb261f53 KY |
1955 | </variablelist> |
1956 | </refsect2> | |
1957 | ||
1958 | <refsect2> | |
1959 | <title><!-- SELinux context -->SELinux コンテキスト</title> | |
1960 | <para> | |
1961 | <!-- | |
50a8555e KY |
1962 | If lxc was compiled and installed with SELinux support, and the host |
1963 | system has SELinux enabled, then the SELinux context under which the | |
1964 | container should be run can be specified in the container | |
1965 | configuration. The default is <command>unconfined_t</command>, | |
1966 | which means that lxc will not attempt to change contexts. | |
1967 | See @DATADIR@/lxc/selinux/lxc.te for an example policy and more | |
1968 | information. | |
fb261f53 | 1969 | --> |
dc421f3a KY |
1970 | lxc が SELinux サポートでコンパイルされ、インストールされている場合で、ホストで SELinux が有効な場合、コンテナが従って動くべき SELinux コンテキストは、コンテナの設定で指定することが可能です。 |
1971 | デフォルトは <command>unconfined_t</command> であり、これは lxc がコンテキストを変えないという意味になります。 | |
03c315af | 1972 | ポリシーの例と追加の情報は @DATADIR@/lxc/selinux/lxc.te ファイルを参照してください。 |
fb261f53 KY |
1973 | </para> |
1974 | <variablelist> | |
50a8555e KY |
1975 | <varlistentry> |
1976 | <term> | |
b84702ab | 1977 | <option>lxc.selinux.context</option> |
50a8555e KY |
1978 | </term> |
1979 | <listitem> | |
1980 | <para> | |
fb261f53 | 1981 | <!-- |
50a8555e KY |
1982 | Specify the SELinux context under which the container should |
1983 | be run or <command>unconfined_t</command>. For example | |
fb261f53 | 1984 | --> |
dc421f3a | 1985 | コンテナが従うべき SELinux コンテキストを指定するか、<command>unconfined_t</command> を指定します。例えば以下のように設定します。 |
50a8555e | 1986 | </para> |
b84702ab | 1987 | <programlisting>lxc.selinux.context = system_u:system_r:lxc_t:s0:c22</programlisting> |
50a8555e KY |
1988 | </listitem> |
1989 | </varlistentry> | |
fb261f53 KY |
1990 | </variablelist> |
1991 | </refsect2> | |
1992 | ||
1993 | <refsect2> | |
1994 | <title><!-- Seccomp configuration -->Seccomp の設定</title> | |
1995 | <para> | |
1996 | <!-- | |
1997 | A container can be started with a reduced set of available | |
50a8555e KY |
1998 | system calls by loading a seccomp profile at startup. The |
1999 | seccomp configuration file must begin with a version number | |
2000 | on the first line, a policy type on the second line, followed | |
2001 | by the configuration. | |
fb261f53 | 2002 | --> |
dc421f3a KY |
2003 | コンテナは、起動時に seccomp プロファイルをロードすることで、利用可能なシステムコールを減らして起動することが可能です。 |
2004 | seccomp の設定ファイルは、1 行目がバージョン番号、2 行目がポリシーのタイプで始まる必要があり、その後に設定を書きます。 | |
fb261f53 | 2005 | </para> |
4473e38b KY |
2006 | <para> |
2007 | <!-- | |
2008 | Versions 1 and 2 are currently supported. In version 1, the | |
50a8555e KY |
2009 | policy is a simple whitelist. The second line therefore must |
2010 | read "whitelist", with the rest of the file containing one (numeric) | |
2011 | sycall number per line. Each syscall number is whitelisted, | |
2012 | while every unlisted number is blacklisted for use in the container | |
4473e38b | 2013 | --> |
dc421f3a KY |
2014 | 現時点では、バージョン番号は 1 と 2 をサポートしています。バージョン 1 では、ポリシーはシンプルなホワイトリストですので、2 行目は "whitelist" でなければなりません。 |
2015 | そして残りの行には 1 行に 1 つずつ、システムコール番号を書きます。各行のシステムコール番号がホワイトリスト化され、リストにない番号は、そのコンテナではブラックリストに入ります。 | |
4473e38b KY |
2016 | </para> |
2017 | ||
2018 | <para> | |
2019 | <!-- | |
2020 | In version 2, the policy may be blacklist or whitelist, | |
2021 | supports per-rule and per-policy default actions, and supports | |
2022 | per-architecture system call resolution from textual names. | |
2023 | --> | |
dc421f3a | 2024 | バージョン 2 では、ポリシーはブラックリストもしくはホワイトリストで表され、ルールごとのアクションと、ポリシーごとのデフォルトのアクションを設定できます。そして、アーキテクチャごとの設定と、テキストで書かれたシステムコール名での設定が可能です。 |
4473e38b KY |
2025 | </para> |
2026 | <para> | |
2027 | <!-- | |
2028 | An example blacklist policy, in which all system calls are | |
2029 | allowed except for mknod, which will simply do nothing and | |
2030 | return 0 (success), looks like: | |
2031 | --> | |
dc421f3a | 2032 | 以下にブラックリストのポリシーの例を示します。これは mknod 以外の全てのシステムコールが許可され、mknod が呼ばれると、何もせずに単に 0(成功) を返します。 |
4473e38b | 2033 | </para> |
2513f519 KY |
2034 | |
2035 | <programlisting> | |
2036 | 2 | |
2037 | blacklist | |
2038 | mknod errno 0 | |
2039 | </programlisting> | |
2040 | ||
fb261f53 | 2041 | <variablelist> |
50a8555e KY |
2042 | <varlistentry> |
2043 | <term> | |
e71b47b2 | 2044 | <option>lxc.seccomp.profile</option> |
50a8555e KY |
2045 | </term> |
2046 | <listitem> | |
2047 | <para> | |
fb261f53 | 2048 | <!-- |
50a8555e KY |
2049 | Specify a file containing the seccomp configuration to |
2050 | load before the container starts. | |
fb261f53 | 2051 | --> |
dc421f3a | 2052 | コンテナがスタートする前にロードする seccomp の設定を含むファイルを指定します。 |
50a8555e KY |
2053 | </para> |
2054 | </listitem> | |
2055 | </varlistentry> | |
fb261f53 KY |
2056 | </variablelist> |
2057 | </refsect2> | |
2058 | ||
16e58f07 KY |
2059 | <refsect2> |
2060 | <title>PR_SET_NO_NEW_PRIVS</title> | |
2061 | <para> | |
2062 | <!-- | |
2063 | With PR_SET_NO_NEW_PRIVS active execve() promises not to grant | |
2064 | privileges to do anything that could not have been done without | |
2065 | the execve() call (for example, rendering the set-user-ID and | |
2066 | set-group-ID mode bits, and file capabilities non-functional). | |
2067 | Once set, this bit cannot be unset. The setting of this bit is | |
2068 | inherited by children created by fork() and clone(), and preserved | |
2069 | across execve(). | |
2070 | Note that PR_SET_NO_NEW_PRIVS is applied after the container has | |
2071 | changed into its intended AppArmor profile or SElinux context. | |
2072 | --> | |
2073 | PR_SET_NO_NEW_PRIVS を付与すると、対象の execve() は、execve() の呼び出しなしでは実行できなかったことに対する特権を許可しなくなります (例えば、set-user-ID、set-group-ID 許可ビットや、ファイルケーパビリティが動作しなくなります)。 | |
2074 | 一度設定されると、このビットは解除できません。このビットの設定は fork() や clone() で生成される子プロセスにも継承され、execve() の前後で保持されます。 | |
2075 | PR_SET_NO_NEW_PRIVS は、コンテナに適用しようとする AppArmor プロファイルもしくは SELinux コンテキストへの変更がなされたあとに適用されます。 | |
2076 | </para> | |
2077 | <variablelist> | |
2078 | <varlistentry> | |
2079 | <term> | |
2080 | <option>lxc.no_new_privs</option> | |
2081 | </term> | |
2082 | <listitem> | |
2083 | <para> | |
50a8555e | 2084 | <!-- |
16e58f07 KY |
2085 | Specify whether the PR_SET_NO_NEW_PRIVS flag should be set for the |
2086 | container. Set to 1 to activate. | |
50a8555e KY |
2087 | --> |
2088 | コンテナに対して PR_SET_NO_NEW_PRIVS ビットを設定するかどうかを指定します。1 に設定すると有効になります。 | |
16e58f07 KY |
2089 | </para> |
2090 | </listitem> | |
2091 | </varlistentry> | |
2092 | </variablelist> | |
2093 | </refsect2> | |
2094 | ||
fb261f53 KY |
2095 | <refsect2> |
2096 | <title><!-- UID mappings -->UID のマッピング</title> | |
2097 | <para> | |
2098 | <!-- | |
2099 | A container can be started in a private user namespace with | |
50a8555e KY |
2100 | user and group id mappings. For instance, you can map userid |
2101 | 0 in the container to userid 200000 on the host. The root | |
2102 | user in the container will be privileged in the container, | |
2103 | but unprivileged on the host. Normally a system container | |
2104 | will want a range of ids, so you would map, for instance, | |
2105 | user and group ids 0 through 20,000 in the container to the | |
2106 | ids 200,000 through 220,000. | |
fb261f53 | 2107 | --> |
dc421f3a KY |
2108 | コンテナは、ユーザとグループの id のマッピングを持った専用のユーザ名前空間で起動することが可能です。 |
2109 | たとえば、コンテナ内のユーザ id 0 を、ホストのユーザ id 200000 にマッピングすることが可能です。 | |
2110 | コンテナの root ユーザはコンテナ内では特権を持ちますが、ホストでは特権を持ちません。 | |
2111 | 通常は、システムコンテナは id の範囲を要求し、それをマッピングします。 | |
2112 | 例えば、コンテナ内のユーザとグループの id 0 から 20,000 を 200,000 から 220,000 にマッピングします。 | |
fb261f53 KY |
2113 | </para> |
2114 | <variablelist> | |
50a8555e KY |
2115 | <varlistentry> |
2116 | <term> | |
bdcbb6b3 | 2117 | <option>lxc.idmap</option> |
50a8555e KY |
2118 | </term> |
2119 | <listitem> | |
2120 | <para> | |
2121 | <!-- | |
2122 | Four values must be provided. First a character, either | |
2123 | 'u', or 'g', to specify whether user or group ids are | |
2124 | being mapped. Next is the first userid as seen in the | |
2125 | user namespace of the container. Next is the userid as | |
2126 | seen on the host. Finally, a range indicating the number | |
2127 | of consecutive ids to map. | |
fb261f53 | 2128 | --> |
dc421f3a KY |
2129 | 4 つの値を記述する必要があります。 |
2130 | 最初の文字は 'u' か 'g' のどちらかで、ユーザかグループの ID のどちらをマッピングするかを指定します。 | |
2131 | 次はコンテナのユーザ名前空間内に現れる最初のユーザ ID です。 | |
2132 | その次は、そのユーザ ID のホスト上での値です。 | |
2133 | 最後は、ID のマッピングをいくつ連続して行うかの数を指定します。 | |
50a8555e KY |
2134 | </para> |
2135 | </listitem> | |
2136 | </varlistentry> | |
fb261f53 KY |
2137 | </variablelist> |
2138 | </refsect2> | |
2139 | ||
2140 | <refsect2> | |
2141 | <title><!-- Container hooks -->コンテナのフック</title> | |
2142 | <para> | |
2143 | <!-- | |
2144 | Container hooks are programs or scripts which can be executed | |
50a8555e | 2145 | at various times in a container's lifetime. |
fb261f53 | 2146 | --> |
dc421f3a | 2147 | コンテナのフックは、コンテナの存続期間の色々な場面で実行することのできるプログラムやスクリプトです。 |
fb261f53 KY |
2148 | </para> |
2149 | <para> | |
2150 | <!-- | |
2151 | When a container hook is executed, information is passed both | |
50a8555e KY |
2152 | as command line arguments and through environment variables. |
2153 | The arguments are: | |
2154 | <itemizedlist> | |
2155 | <listitem><para> Container name. </para></listitem> | |
2156 | <listitem><para> Section (always 'lxc'). </para></listitem> | |
2157 | <listitem><para> The hook type (i.e. 'clone' or 'pre-mount'). </para></listitem> | |
2158 | <listitem><para> Additional arguments. In the | |
2159 | case of the clone hook, any extra arguments passed to | |
d0b2a434 KY |
2160 | lxc-clone will appear as further arguments to the hook. |
2161 | In the case of the stop hook, paths to filedescriptors | |
2162 | for each of the container's namespaces along with their types | |
2163 | are passed. </para></listitem> | |
50a8555e KY |
2164 | </itemizedlist> |
2165 | The following environment variables are set: | |
2166 | <itemizedlist> | |
2167 | <listitem><para> LXC_NAME: is the container's name. </para></listitem> | |
2168 | <listitem><para> LXC_ROOTFS_MOUNT: the path to the mounted root filesystem. </para></listitem> | |
2169 | <listitem><para> LXC_CONFIG_FILE: the path to the container configuration file. </para></listitem> | |
2170 | <listitem><para> LXC_SRC_NAME: in the case of the clone hook, this is the original container's name. </para></listitem> | |
a64f3157 | 2171 | <listitem><para> LXC_ROOTFS_PATH: this is the lxc.rootfs.path entry for the container. Note this is likely not where the mounted rootfs is to be found, use LXC_ROOTFS_MOUNT for that. </para></listitem> |
50a8555e | 2172 | </itemizedlist> |
fb261f53 | 2173 | --> |
dc421f3a | 2174 | コンテナのフックが実行されるとき、情報がコマンドライン引数と環境変数の両方を通して渡されます。引数は: |
50a8555e KY |
2175 | <itemizedlist> |
2176 | <listitem><para>コンテナ名</para></listitem> | |
2177 | <listitem><para>セクション (常に 'lxc')</para></listitem> | |
2178 | <listitem><para>フックのタイプ ('clone' や 'pre-mount' など)</para></listitem> | |
2179 | <listitem><para>追加の引数。clone フックの場合、lxc-clone に渡される追加の引数は、フックへの引数として追加されます。stop フックの場合は、コンテナの名前空間のそれぞれに対するファイルディスクリプタへのパスが、名前空間名とともに渡されます。</para></listitem> | |
2180 | </itemizedlist> | |
dc421f3a | 2181 | 以下の環境変数がセットされます。 |
50a8555e KY |
2182 | <itemizedlist> |
2183 | <listitem><para> LXC_NAME: コンテナ名</para></listitem> | |
2184 | <listitem><para> LXC_ROOTFS_MOUNT: マウントされた root ファイルシステムへのパス</para></listitem> | |
2185 | <listitem><para> LXC_CONFIG_FILE: コンテナの設定ファイルのパス </para></listitem> | |
2186 | <listitem><para> LXC_SRC_NAME: clone フックの場合、元のコンテナの名前</para></listitem> | |
a64f3157 | 2187 | <listitem><para> LXC_ROOTFS_PATH: コンテナの lxc.rootfs.path エントリ。これはマウントされた rootfs が存在する場所にはならないでしょう。それには LXC_ROOTFS_MOUNT を使用してください。</para></listitem> |
fb261f53 KY |
2188 | </itemizedlist> |
2189 | </para> | |
2190 | <para> | |
2191 | <!-- | |
2192 | Standard output from the hooks is logged at debug level. | |
2193 | Standard error is not logged, but can be captured by the | |
2194 | hook redirecting its standard error to standard output. | |
2195 | --> | |
dc421f3a KY |
2196 | スクリプトからの標準出力は debug レベルでロギングされます。 |
2197 | 標準エラー出力はロギングされません。 | |
2198 | しかし、フックの標準エラー出力を標準出力にリダイレクトすることにより保存することは可能です。 | |
fb261f53 KY |
2199 | </para> |
2200 | <variablelist> | |
50a8555e KY |
2201 | <varlistentry> |
2202 | <term> | |
2203 | <option>lxc.hook.pre-start</option> | |
2204 | </term> | |
2205 | <listitem> | |
2206 | <para> | |
fb261f53 | 2207 | <!-- |
50a8555e KY |
2208 | A hook to be run in the host's namespace before the |
2209 | container ttys, consoles, or mounts are up. | |
fb261f53 | 2210 | --> |
dc421f3a | 2211 | コンテナの tty、コンソールの作成、マウントが実行される前に、ホストの名前空間内で実行するフック。 |
50a8555e KY |
2212 | </para> |
2213 | </listitem> | |
2214 | </varlistentry> | |
fb261f53 KY |
2215 | </variablelist> |
2216 | <variablelist> | |
50a8555e KY |
2217 | <varlistentry> |
2218 | <term> | |
2219 | <option>lxc.hook.pre-mount</option> | |
2220 | </term> | |
2221 | <listitem> | |
2222 | <para> | |
2223 | <!-- | |
2224 | A hook to be run in the container's fs namespace but before | |
2225 | the rootfs has been set up. This allows for manipulation | |
2226 | of the rootfs, i.e. to mount an encrypted filesystem. Mounts | |
2227 | done in this hook will not be reflected on the host (apart from | |
2228 | mounts propagation), so they will be automatically cleaned up | |
2229 | when the container shuts down. | |
fb261f53 | 2230 | --> |
dc421f3a KY |
2231 | コンテナのファイルシステムの名前空間で実行されますが、rootfs が設定される前に実行するフック。 |
2232 | これにより rootfs の操作が可能になります。 | |
2233 | 例えば、暗号化されたファイルシステムのマウントなどです。 | |
2234 | このフック内でなされるマウントはホストには影響しません (mounts propagation を除いて)。 | |
2235 | なので、それらはコンテナがシャットダウンする時に自動的にクリーンアップされます。 | |
50a8555e KY |
2236 | </para> |
2237 | </listitem> | |
2238 | </varlistentry> | |
fb261f53 KY |
2239 | </variablelist> |
2240 | <variablelist> | |
50a8555e KY |
2241 | <varlistentry> |
2242 | <term> | |
2243 | <option>lxc.hook.mount</option> | |
2244 | </term> | |
2245 | <listitem> | |
2246 | <para> | |
fb261f53 | 2247 | <!-- |
50a8555e KY |
2248 | A hook to be run in the container's namespace after |
2249 | mounting has been done, but before the pivot_root. | |
fb261f53 | 2250 | --> |
dc421f3a | 2251 | マウントが完了した後ですが、pivot_root の前にコンテナの名前空間で実行されるフック。 |
50a8555e KY |
2252 | </para> |
2253 | </listitem> | |
2254 | </varlistentry> | |
fb261f53 KY |
2255 | </variablelist> |
2256 | <variablelist> | |
50a8555e KY |
2257 | <varlistentry> |
2258 | <term> | |
2259 | <option>lxc.hook.autodev</option> | |
2260 | </term> | |
2261 | <listitem> | |
2262 | <para> | |
2263 | <!-- | |
2264 | A hook to be run in the container's namespace after | |
2265 | mounting has been done and after any mount hooks have | |
2266 | run, but before the pivot_root, if | |
2267 | <option>lxc.autodev</option> == 1. | |
2268 | The purpose of this hook is to assist in populating the | |
2269 | /dev directory of the container when using the autodev | |
2270 | option for systemd based containers. The container's /dev | |
2271 | directory is relative to the | |
2272 | ${<option>LXC_ROOTFS_MOUNT</option>} environment | |
2273 | variable available when the hook is run. | |
fb261f53 | 2274 | --> |
dc421f3a KY |
2275 | <option>lxc.autodev</option> == 1 が設定されている場合で、マウントが完了し、マウント時のフックも実行された後ですが、pivot_root の前にコンテナの名前空間で実行するフック。 |
2276 | このフックの目的は、systemd ベースのコンテナ向けの autodev オプションが設定されている時に、コンテナの /dev ディレクトリを設定するのを支援することです。コンテナの /dev ディレクトリは、このフックが実行される時有効な ${<option>LXC_ROOTFS_MOUNT</option>} 環境変数からの相対パスとなります。 | |
50a8555e KY |
2277 | </para> |
2278 | </listitem> | |
1e074e8e KY |
2279 | </varlistentry> |
2280 | </variablelist> | |
2281 | <variablelist> | |
2282 | <varlistentry> | |
2283 | <term> | |
2284 | <option>lxc.hook.start-host</option> | |
2285 | </term> | |
2286 | <listitem> | |
2287 | <para> | |
2288 | <!-- | |
2289 | A hook to be run in the host's namespace after the | |
2290 | container has been setup, and immediately before starting | |
2291 | the container init. | |
2292 | --> | |
2293 | コンテナのセットアップが済んだあと、コンテナの init を実行する直前に、ホストの名前空間で実行するためのフックです。 | |
2294 | </para> | |
2295 | </listitem> | |
50a8555e | 2296 | </varlistentry> |
fb261f53 KY |
2297 | </variablelist> |
2298 | <variablelist> | |
50a8555e KY |
2299 | <varlistentry> |
2300 | <term> | |
2301 | <option>lxc.hook.start</option> | |
2302 | </term> | |
2303 | <listitem> | |
2304 | <para> | |
fb261f53 | 2305 | <!-- |
50a8555e KY |
2306 | A hook to be run in the container's namespace immediately |
2307 | before executing the container's init. This requires the | |
2308 | program to be available in the container. | |
fb261f53 | 2309 | --> |
dc421f3a KY |
2310 | コンテナの init が実行される直前にコンテナの名前空間で実行されるフック。 |
2311 | コンテナ内で利用可能なプログラムである必要があります。 | |
50a8555e KY |
2312 | </para> |
2313 | </listitem> | |
2314 | </varlistentry> | |
fb261f53 | 2315 | </variablelist> |
d0b2a434 KY |
2316 | <variablelist> |
2317 | <varlistentry> | |
2318 | <term> | |
2319 | <option>lxc.hook.stop</option> | |
2320 | </term> | |
2321 | <listitem> | |
2322 | <para> | |
50a8555e | 2323 | <!-- |
d0b2a434 KY |
2324 | A hook to be run in the host's namespace with references |
2325 | to the container's namespaces after the container has been shut | |
2326 | down. For each namespace an extra argument is passed to the hook | |
2327 | containing the namespace's type and a filename that can be used to | |
2328 | obtain a file descriptor to the corresponding namespace, separated | |
2329 | by a colon. The type is the name as it would appear in the | |
2330 | <filename>/proc/PID/ns</filename> directory. | |
2331 | For instance for the mount namespace the argument usually looks | |
2332 | like <filename>mnt:/proc/PID/fd/12</filename>. | |
50a8555e KY |
2333 | --> |
2334 | コンテナのシャットダウン後、コンテナの名前空間への参照とともに、ホストの名前空間で実行されるフックです。 | |
2335 | それぞれの名前空間に対応する追加の引数がフックに渡されます。その引数にはコロンで区切られた名前空間のタイプ名とファイル名が含まれており、ファイル名は名前空間に対するファイルディスクリプタを取得するのに使えます。 | |
2336 | タイプ名は <filename>/proc/PID/ns</filename> ディレクトリ内のファイル名です。 | |
2337 | 例えば、マウント名前空間に対応する引数は通常は <filename>mnt:/proc/PID/fd/12</filename> のようになります。 | |
d0b2a434 KY |
2338 | </para> |
2339 | </listitem> | |
2340 | </varlistentry> | |
2341 | </variablelist> | |
fb261f53 | 2342 | <variablelist> |
50a8555e KY |
2343 | <varlistentry> |
2344 | <term> | |
2345 | <option>lxc.hook.post-stop</option> | |
2346 | </term> | |
2347 | <listitem> | |
2348 | <para> | |
fb261f53 | 2349 | <!-- |
50a8555e KY |
2350 | A hook to be run in the host's namespace after the |
2351 | container has been shut down. | |
fb261f53 | 2352 | --> |
dc421f3a | 2353 | コンテナがシャットダウンされた後にホストの名前空間で実行するフック。 |
50a8555e KY |
2354 | </para> |
2355 | </listitem> | |
2356 | </varlistentry> | |
fb261f53 KY |
2357 | </variablelist> |
2358 | <variablelist> | |
50a8555e KY |
2359 | <varlistentry> |
2360 | <term> | |
2361 | <option>lxc.hook.clone</option> | |
2362 | </term> | |
2363 | <listitem> | |
2364 | <para> | |
fb261f53 | 2365 | <!-- |
50a8555e KY |
2366 | A hook to be run when the container is cloned to a new one. |
2367 | See <citerefentry><refentrytitle><command>lxc-clone</command></refentrytitle> | |
2368 | <manvolnum>1</manvolnum></citerefentry> for more information. | |
fb261f53 | 2369 | --> |
dc421f3a | 2370 | コンテナが新しいコンテナにクローンされる際に実行されるフック。詳しくは |
fb261f53 KY |
2371 | <citerefentry><refentrytitle><command>lxc-clone</command></refentrytitle> |
2372 | <manvolnum>1</manvolnum></citerefentry> | |
dc421f3a | 2373 | を参照してください。 |
50a8555e KY |
2374 | </para> |
2375 | </listitem> | |
2376 | </varlistentry> | |
fb261f53 | 2377 | </variablelist> |
de0dc533 KY |
2378 | <variablelist> |
2379 | <varlistentry> | |
2380 | <term> | |
2381 | <option>lxc.hook.destroy</option> | |
2382 | </term> | |
2383 | <listitem> | |
2384 | <para> | |
2385 | <!-- | |
2386 | A hook to be run when the container is destroyed. | |
2387 | --> | |
2388 | コンテナを破壊する際に実行されるフックです。 | |
2389 | </para> | |
2390 | </listitem> | |
2391 | </varlistentry> | |
2392 | </variablelist> | |
fb261f53 KY |
2393 | </refsect2> |
2394 | ||
2395 | <refsect2> | |
2396 | <title><!-- Container hooks Environment Variables -->コンテナのフックで使える環境変数</title> | |
2397 | <para> | |
2398 | <!-- | |
2399 | A number of environment variables are made available to the startup | |
2400 | hooks to provide configuration information and assist in the | |
2401 | functioning of the hooks. Not all variables are valid in all | |
2402 | contexts. In particular, all paths are relative to the host system | |
2403 | and, as such, not valid during the <option>lxc.hook.start</option> hook. | |
2404 | --> | |
dc421f3a KY |
2405 | 起動時のフックに設定情報を提供し、フックの機能を助けるための環境変数がいくつか利用可能です。 |
2406 | 全ての変数が全てのコンテキストで利用可能なわけではありません。 | |
2407 | 具体的には、全てのパスはホストシステム上のパスであり、そのため、<option>lxc.hook.start</option> フックの時点では使用できません。 | |
fb261f53 KY |
2408 | </para> |
2409 | <variablelist> | |
50a8555e KY |
2410 | <varlistentry> |
2411 | <term> | |
2412 | <option>LXC_NAME</option> | |
2413 | </term> | |
2414 | <listitem> | |
2415 | <para> | |
fb261f53 | 2416 | <!-- |
50a8555e KY |
2417 | The LXC name of the container. Useful for logging messages |
2418 | in common log environments. [<option>-n</option>] | |
fb261f53 | 2419 | --> |
dc421f3a | 2420 | LXC コンテナの名前。共通のログ環境内でのログメッセージに使うときに便利です。[<option>-n</option>] |
50a8555e KY |
2421 | </para> |
2422 | </listitem> | |
2423 | </varlistentry> | |
fb261f53 KY |
2424 | </variablelist> |
2425 | <variablelist> | |
50a8555e KY |
2426 | <varlistentry> |
2427 | <term> | |
2428 | <option>LXC_CONFIG_FILE</option> | |
2429 | </term> | |
2430 | <listitem> | |
2431 | <para> | |
2432 | <!-- | |
2433 | Host relative path to the container configuration file. This | |
2434 | gives the container to reference the original, top level, | |
2435 | configuration file for the container in order to locate any | |
2436 | additional configuration information not otherwise made | |
2437 | available. [<option>-f</option>] | |
fb261f53 | 2438 | --> |
dc421f3a KY |
2439 | コンテナの設定ファイルのホスト上でのパス。 |
2440 | これは、他の方法では得られない追加の設定情報を見つけるために、コンテナに、元の、トップレベルの設定ファイルの位置を与えるものです。 [<option>-f</option>] | |
50a8555e KY |
2441 | </para> |
2442 | </listitem> | |
2443 | </varlistentry> | |
fb261f53 KY |
2444 | </variablelist> |
2445 | <variablelist> | |
50a8555e KY |
2446 | <varlistentry> |
2447 | <term> | |
2448 | <option>LXC_CONSOLE</option> | |
2449 | </term> | |
2450 | <listitem> | |
2451 | <para> | |
fb261f53 | 2452 | <!-- |
50a8555e | 2453 | The path to the console output of the container if not NULL. |
e71b47b2 | 2454 | [<option>-c</option>] [<option>lxc.console.path</option>] |
fb261f53 | 2455 | --> |
dc421f3a | 2456 | 設定されている場合のコンテナのコンソール出力のパス。 |
e71b47b2 | 2457 | [<option>-c</option>] [<option>lxc.console.path</option>] |
50a8555e KY |
2458 | </para> |
2459 | </listitem> | |
2460 | </varlistentry> | |
fb261f53 KY |
2461 | </variablelist> |
2462 | <variablelist> | |
50a8555e KY |
2463 | <varlistentry> |
2464 | <term> | |
2465 | <option>LXC_CONSOLE_LOGPATH</option> | |
2466 | </term> | |
2467 | <listitem> | |
2468 | <para> | |
fb261f53 | 2469 | <!-- |
50a8555e KY |
2470 | The path to the console log output of the container if not NULL. |
2471 | [<option>-L</option>] | |
fb261f53 | 2472 | --> |
dc421f3a | 2473 | 設定されている場合のコンテナのコンソールログ出力のパス。 |
50a8555e KY |
2474 | [<option>-L</option>] |
2475 | </para> | |
2476 | </listitem> | |
2477 | </varlistentry> | |
fb261f53 KY |
2478 | </variablelist> |
2479 | <variablelist> | |
50a8555e KY |
2480 | <varlistentry> |
2481 | <term> | |
2482 | <option>LXC_ROOTFS_MOUNT</option> | |
2483 | </term> | |
2484 | <listitem> | |
2485 | <para> | |
2486 | <!-- | |
2487 | The mount location to which the container is initially bound. | |
2488 | This will be the host relative path to the container rootfs | |
2489 | for the container instance being started and is where changes | |
2490 | should be made for that instance. | |
2491 | [<option>lxc.rootfs.mount</option>] | |
fb261f53 | 2492 | --> |
dc421f3a KY |
2493 | 初期にコンテナがマウントされる場所。 |
2494 | これは、コンテナインスタンスが起動するためのコンテナの rootfs へのホスト上のパスであり、インスタンスのための移行が行われる場所です。 | |
50a8555e KY |
2495 | [<option>lxc.rootfs.mount</option>] |
2496 | </para> | |
2497 | </listitem> | |
2498 | </varlistentry> | |
fb261f53 KY |
2499 | </variablelist> |
2500 | <variablelist> | |
50a8555e KY |
2501 | <varlistentry> |
2502 | <term> | |
2503 | <option>LXC_ROOTFS_PATH</option> | |
2504 | </term> | |
2505 | <listitem> | |
2506 | <para> | |
fb261f53 | 2507 | <!-- |
50a8555e KY |
2508 | The host relative path to the container root which has been |
2509 | mounted to the rootfs.mount location. | |
a64f3157 | 2510 | [<option>lxc.rootfs.path</option>] |
fb261f53 | 2511 | --> |
dc421f3a | 2512 | rootfs.mount へマウントされるコンテナのルートへのホスト上のパスです。 |
a64f3157 | 2513 | [<option>lxc.rootfs.path</option>] |
50a8555e KY |
2514 | </para> |
2515 | </listitem> | |
2516 | </varlistentry> | |
fb261f53 | 2517 | </variablelist> |
07945418 KY |
2518 | <variablelist> |
2519 | <varlistentry> | |
2520 | <term> | |
2521 | <option>LXC_SRC_NAME</option> | |
2522 | </term> | |
2523 | <listitem> | |
2524 | <para> | |
2525 | <!-- | |
2526 | Only for the clone hook. Is set to the original container name. | |
2527 | --> | |
2528 | clone フックの場合のみ使われます。クローン元のコンテナ名が設定されます。 | |
2529 | </para> | |
2530 | </listitem> | |
2531 | </varlistentry> | |
2532 | </variablelist> | |
3c08e893 KY |
2533 | <variablelist> |
2534 | <varlistentry> | |
2535 | <term> | |
2536 | <option>LXC_TARGET</option> | |
2537 | </term> | |
2538 | <listitem> | |
2539 | <para> | |
50a8555e | 2540 | <!-- |
3c08e893 KY |
2541 | Only for the stop hook. Is set to "stop" for a container |
2542 | shutdown or "reboot" for a container reboot. | |
50a8555e KY |
2543 | --> |
2544 | stop フックの場合のみ使われます。コンテナのシャットダウンの場合は "stop"、リブートの場合は "reboot" が設定されます。 | |
3c08e893 KY |
2545 | </para> |
2546 | </listitem> | |
2547 | </varlistentry> | |
2548 | </variablelist> | |
63f2635d KY |
2549 | <variablelist> |
2550 | <varlistentry> | |
2551 | <term> | |
2552 | <option>LXC_CGNS_AWARE</option> | |
2553 | </term> | |
2554 | <listitem> | |
2555 | <para> | |
2556 | <!-- | |
2557 | If unset, then this version of lxc is not aware of cgroup | |
2558 | namespaces. If set, it will be set to 1, and lxc is aware | |
2559 | of cgroup namespaces. Note this does not guarantee that | |
2560 | cgroup namespaces are enabled in the kernel. This is used | |
2561 | by the lxcfs mount hook. | |
2562 | --> | |
cd548c9d KY |
2563 | この変数が設定されていない場合、お使いのバージョンの LXC は cgroup 名前空間を扱えません。設定されている場合、この値は 1 に設定されています。そして、cgroup 名前空間を扱えます。 |
2564 | この変数はカーネルで cgroup 名前空間が有効であることは保証しません。この変数は lxcfs のマウントフックが使います。 | |
63f2635d KY |
2565 | </para> |
2566 | </listitem> | |
2567 | </varlistentry> | |
2568 | </variablelist> | |
fb261f53 KY |
2569 | </refsect2> |
2570 | ||
2571 | <refsect2> | |
2572 | <title><!-- Logging -->ロギング</title> | |
2573 | <para> | |
2574 | <!-- | |
2575 | Logging can be configured on a per-container basis. By default, | |
2576 | depending upon how the lxc package was compiled, container startup | |
2577 | is logged only at the ERROR level, and logged to a file named after | |
2578 | the container (with '.log' appended) either under the container path, | |
2579 | or under @LOGPATH@. | |
2580 | --> | |
dc421f3a KY |
2581 | ロギングはコンテナごとに設定することが可能です。 |
2582 | デフォルトでは、lxc パッケージのコンパイル条件に依存し、コンテナのスタートアップは ERROR レベルでのみロギングされ、コンテナのパス以下か、@LOGPATH@ 以下のどちらかにコンテナ名 (の後に '.log' が付与される) をもとにした名前でロギングされます。 | |
fb261f53 KY |
2583 | </para> |
2584 | <para> | |
2585 | <!-- | |
2586 | Both the default log level and the log file can be specified in the | |
2587 | container configuration file, overriding the default behavior. Note | |
2588 | that the configuration file entries can in turn be overridden by the | |
2589 | command line options to <command>lxc-start</command>. | |
2590 | --> | |
dc421f3a KY |
2591 | デフォルトのログレベルとログファイルは両方とも、コンテナの設定ファイル内で指定され、デフォルトの値を上書きします。 |
2592 | 同様に、設定ファイルのエントリは <command>lxc-start</command> のコマンドラインオプションで上書きすることも可能です。 | |
fb261f53 KY |
2593 | </para> |
2594 | <variablelist> | |
50a8555e KY |
2595 | <varlistentry> |
2596 | <term> | |
46cc906d | 2597 | <option>lxc.log.level</option> |
50a8555e KY |
2598 | </term> |
2599 | <listitem> | |
2600 | <para> | |
2601 | <!-- | |
2602 | The level at which to log. The log level is an integer in | |
2603 | the range of 0..8 inclusive, where a lower number means more | |
2604 | verbose debugging. In particular 0 = trace, 1 = debug, 2 = | |
2605 | info, 3 = notice, 4 = warn, 5 = error, 6 = critical, 7 = | |
2606 | alert, and 8 = fatal. If unspecified, the level defaults | |
2607 | to 5 (error), so that only errors and above are logged. | |
fb261f53 | 2608 | --> |
dc421f3a KY |
2609 | ログを取得するレベル。 |
2610 | ログレベルは 0..8 の範囲の整数です。 | |
2611 | 数字が小さいほど冗長なデバッグを意味します。 | |
2612 | 具体的には、0 = trace, 1 = debug, 2 = info, 3 = notice, 4 = warn, 5 = error, 6 = critical, 7 = alert, and 8 = fatal です。 | |
2613 | 指定されない場合、レベルのデフォルトは 5 (error) で、それ以上のエラーがロギングされます。 | |
50a8555e KY |
2614 | </para> |
2615 | <para> | |
fb261f53 | 2616 | <!-- |
50a8555e KY |
2617 | Note that when a script (such as either a hook script or a |
2618 | network interface up or down script) is called, the script's | |
2619 | standard output is logged at level 1, debug. | |
fb261f53 | 2620 | --> |
dc421f3a | 2621 | (フックスクリプトやネットワークインターフェースの起動、停止時のスクリプトのような) スクリプトが呼ばれた時、スクリプトの標準出力は level 1 の debug でロギングされます。 |
50a8555e KY |
2622 | </para> |
2623 | </listitem> | |
2624 | </varlistentry> | |
2625 | <varlistentry> | |
2626 | <term> | |
46cc906d | 2627 | <option>lxc.log</option> |
50a8555e KY |
2628 | </term> |
2629 | <listitem> | |
2630 | <para> | |
2631 | <!-- | |
2632 | The file to which logging info should be written. | |
fb261f53 | 2633 | --> |
dc421f3a | 2634 | ログ情報を書き込むファイル。 |
50a8555e KY |
2635 | </para> |
2636 | </listitem> | |
2637 | </varlistentry> | |
917420dd KY |
2638 | <varlistentry> |
2639 | <term> | |
46cc906d | 2640 | <option>lxc.log.syslog</option> |
917420dd KY |
2641 | </term> |
2642 | <listitem> | |
2643 | <para> | |
50a8555e | 2644 | <!-- |
917420dd | 2645 | Send logging info to syslog. It respects the log level defined in |
46cc906d | 2646 | <command>lxc.log.level</command>. The argument should be the syslog |
917420dd KY |
2647 | facility to use, valid ones are: daemon, local0, local1, local2, |
2648 | local3, local4, local5, local5, local7. | |
50a8555e | 2649 | --> |
46cc906d | 2650 | ログ情報を syslog に送ります。ログレベルとして <command>lxc.log.level</command> の値を使用します。指定する値は使用する syslog の facility です。有効な値は daemon, local0, local1, local2, local3, local4, local5, local5, local6, local7 のいずれかです。 |
917420dd KY |
2651 | </para> |
2652 | </listitem> | |
2653 | </varlistentry> | |
fb261f53 KY |
2654 | </variablelist> |
2655 | </refsect2> | |
2656 | ||
2657 | <refsect2> | |
2658 | <title><!-- Autostart -->自動起動</title> | |
2659 | <para> | |
2660 | <!-- | |
2661 | The autostart options support marking which containers should be | |
2662 | auto-started and in what order. These options may be used by LXC tools | |
2663 | directly or by external tooling provided by the distributions. | |
2664 | --> | |
dc421f3a KY |
2665 | 自動起動オプションでは、自動起動させるコンテナと順番の設定が可能です。 |
2666 | このオプションは LXC ツールが直接使用するか、ディストリビューションが提供する外部ツールが使用するかもしれません。 | |
fb261f53 KY |
2667 | </para> |
2668 | ||
2669 | <variablelist> | |
2670 | <varlistentry> | |
2671 | <term> | |
2672 | <option>lxc.start.auto</option> | |
2673 | </term> | |
2674 | <listitem> | |
2675 | <para> | |
2676 | <!-- | |
2677 | Whether the container should be auto-started. | |
2678 | Valid values are 0 (off) and 1 (on). | |
2679 | --> | |
dc421f3a KY |
2680 | コンテナを自動起動させるかどうかを設定します。 |
2681 | 有効な値は 0(オフ) か 1(オン) です。 | |
fb261f53 KY |
2682 | </para> |
2683 | </listitem> | |
2684 | </varlistentry> | |
2685 | <varlistentry> | |
2686 | <term> | |
2687 | <option>lxc.start.delay</option> | |
2688 | </term> | |
2689 | <listitem> | |
2690 | <para> | |
2691 | <!-- | |
2692 | How long to wait (in seconds) after the container is | |
2693 | started before starting the next one. | |
2694 | --> | |
dc421f3a | 2695 | コンテナを起動させた後、次のコンテナを起動させるまでにどれくらい (秒) 待つかを設定します。 |
fb261f53 KY |
2696 | </para> |
2697 | </listitem> | |
2698 | </varlistentry> | |
2699 | <varlistentry> | |
2700 | <term> | |
2701 | <option>lxc.start.order</option> | |
2702 | </term> | |
2703 | <listitem> | |
2704 | <para> | |
2705 | <!-- | |
2706 | An integer used to sort the containers when auto-starting | |
2707 | a series of containers at once. | |
2708 | --> | |
dc421f3a | 2709 | 多数の自動起動させるコンテナがある場合のコンテナの起動順を決めるのに使う整数を指定します。 |
fb261f53 KY |
2710 | </para> |
2711 | </listitem> | |
2712 | </varlistentry> | |
86b484e9 KY |
2713 | <varlistentry> |
2714 | <term> | |
2715 | <option>lxc.monitor.unshare</option> | |
2716 | </term> | |
2717 | <listitem> | |
2718 | <para> | |
2719 | <!-- | |
2720 | If not zero the mount namespace will be unshared from the host | |
2721 | before initializing the container (before running any pre-start | |
2722 | hooks). This requires the CAP_SYS_ADMIN capability at startup. | |
2723 | Default is 0. | |
2724 | --> | |
2725 | この値が 0 でない場合、コンテナが初期化される前 (pre-start フックが実行される前) にマウント名前空間がホストから unshare されます。この機能を使う場合、スタート時に CAP_SYS_ADMIN ケーパビリティが必要です。デフォルト値は 0 です。 | |
2726 | </para> | |
2727 | </listitem> | |
2728 | </varlistentry> | |
fb261f53 KY |
2729 | <varlistentry> |
2730 | <term> | |
2731 | <option>lxc.group</option> | |
2732 | </term> | |
2733 | <listitem> | |
2734 | <para> | |
2735 | <!-- | |
2736 | A multi-value key (can be used multiple times) to put the | |
2737 | container in a container group. Those groups can then be | |
2738 | used (amongst other things) to start a series of related | |
2739 | containers. | |
2740 | --> | |
dc421f3a | 2741 | コンテナを追加したいコンテナグループ名を指定します。 |
4db216f7 | 2742 | 複数の値を設定でき、複数回指定することもできます。 |
dc421f3a | 2743 | 設定されたグループは、関連する一連のコンテナを起動させるために使われます。 |
fb261f53 KY |
2744 | </para> |
2745 | </listitem> | |
2746 | </varlistentry> | |
2747 | </variablelist> | |
2748 | </refsect2> | |
2749 | ||
f57517ef KY |
2750 | <refsect2> |
2751 | <title><!-- Autostart and System Boot -->自動起動とシステムブート</title> | |
2752 | <para> | |
2753 | <!-- | |
2754 | Each container can be part of any number of groups or no group at all. | |
2755 | Two groups are special. One is the NULL group, i.e. the container does | |
2756 | not belong to any group. The other group is the "onboot" group. | |
2757 | --> | |
2758 | コンテナはいくつでもグループに属することができ、全く属さないことも可能です。特別なグループが 2 つ存在します。1 つは NULL グループです。これはどのグループにも属さないコンテナです。もう 1 つは "onboot" グループです。 | |
2759 | </para> | |
2760 | ||
2761 | <para> | |
2762 | <!-- | |
2763 | When the system boots with the LXC service enabled, it will first | |
2764 | attempt to boot any containers with lxc.start.auto == 1 that is a member | |
2765 | of the "onboot" group. The startup will be in order of lxc.start.order. | |
2766 | If an lxc.start.delay has been specified, that delay will be honored | |
2767 | before attempting to start the next container to give the current | |
2768 | container time to begin initialization and reduce overloading the host | |
2769 | system. After starting the members of the "onboot" group, the LXC system | |
2770 | will proceed to boot containers with lxc.start.auto == 1 which are not | |
2771 | members of any group (the NULL group) and proceed as with the onboot | |
2772 | group. | |
2773 | --> | |
2774 | LXC サービスが有効になった状態でシステムがブートすると、最初に "onboot" グループのメンバーである lxc.start.auto == 1 が設定されたコンテナを起動しようとします。起動は lxc.start.order の順に起動します。 | |
2775 | lxc.start.delay が指定されている場合、現在対象となっているコンテナに初期化の時間を与え、ホストシステムの負荷を低減するために、次のコンテナを開始させるまでに遅延時間を与えます。 | |
2776 | "onboot" グループのメンバーが開始した後、LXC システムは lxc.start.auto == 1 が設定された、どのグループのメンバーでもない (NULL グループの) コンテナのブートを onboot グループのコンテナと同様に開始します。 | |
2777 | </para> | |
2778 | ||
2779 | </refsect2> | |
9231d3a4 KY |
2780 | |
2781 | <refsect2> | |
2782 | <title><!-- Container Environment -->コンテナの環境変数</title> | |
2783 | <para> | |
2784 | <!-- | |
50a8555e KY |
2785 | If you want to pass environment variables into the container (that |
2786 | is, environment variables which will be available to init and all of | |
2787 | its descendents), you can use <command>lxc.environment</command> | |
2788 | parameters to do so. Be careful that you do not pass in anything | |
2789 | sensitive; any process in the container which doesn't have its | |
2790 | environment scrubbed will have these variables available to it, and | |
2791 | environment variables are always available via | |
2792 | <command>/proc/PID/environ</command>. | |
9231d3a4 KY |
2793 | --> |
2794 | コンテナに環境変数を渡したい場合 (環境変数はコンテナの init とその子孫全てで利用可能です)、<command>lxc.environment</command> パラメータがその用途に使えます。 | |
2795 | 機微 (センシティブ) な情報を渡さないように注意が必要です。そのような情報を持たないコンテナ内のプロセスでこれらの環境変数が利用可能になってしまいます。環境変数は常に <command>/proc/PID/environ</command> 経由で利用可能になります。 | |
2796 | </para> | |
2797 | ||
2798 | <para> | |
2799 | <!-- | |
2800 | This configuration parameter can be specified multiple times; once | |
2801 | for each environment variable you wish to configure. | |
2802 | --> | |
2803 | この設定項目は、設定したい環境変数ごとに 1 度ずつ、何度でも指定できます。 | |
2804 | </para> | |
2805 | ||
2806 | <variablelist> | |
50a8555e KY |
2807 | <varlistentry> |
2808 | <term> | |
2809 | <option>lxc.environment</option> | |
2810 | </term> | |
2811 | <listitem> | |
2812 | <para> | |
9231d3a4 | 2813 | <!-- |
50a8555e KY |
2814 | Specify an environment variable to pass into the container. |
2815 | Example: | |
9231d3a4 KY |
2816 | --> |
2817 | コンテナに渡したい環境変数を指定します。 | |
2818 | 例: | |
50a8555e KY |
2819 | </para> |
2820 | <programlisting> | |
2821 | lxc.environment = APP_ENV=production | |
2822 | lxc.environment = SYSLOG_SERVER=192.0.2.42 | |
2823 | </programlisting> | |
2824 | </listitem> | |
2825 | </varlistentry> | |
9231d3a4 KY |
2826 | </variablelist> |
2827 | </refsect2> | |
2828 | ||
fb261f53 KY |
2829 | </refsect1> |
2830 | ||
2831 | <refsect1> | |
2832 | <title><!-- Examples -->例</title> | |
2833 | <para> | |
2834 | <!-- | |
50a8555e KY |
2835 | In addition to the few examples given below, you will find |
2836 | some other examples of configuration file in @DOCDIR@/examples | |
fb261f53 | 2837 | --> |
dc421f3a | 2838 | 以下に紹介するいくつかの例に加えて、他の設定例が @DOCDIR@/examples にあります。 |
fb261f53 KY |
2839 | </para> |
2840 | <refsect2> | |
2841 | <title><!-- Network -->ネットワーク</title> | |
2842 | <para> | |
2843 | <!-- | |
2844 | This configuration sets up a container to use a veth pair | |
50a8555e KY |
2845 | device with one side plugged to a bridge br0 (which has been |
2846 | configured before on the system by the administrator). The | |
2847 | virtual network device visible in the container is renamed to | |
2848 | eth0. | |
fb261f53 | 2849 | --> |
dc421f3a KY |
2850 | この設定は、片方をブリッジである br0 と接続される veth ペアデバイスを使うコンテナを設定します (ブリッジは管理者によりあらかじめシステム上に設定済みである必要があります)。 |
2851 | 仮想ネットワークデバイスは、コンテナ内では eth0 とリネームされます。 | |
fb261f53 KY |
2852 | </para> |
2853 | <programlisting> | |
b67771bc | 2854 | lxc.uts.name = myhostname |
7fa3f2e9 | 2855 | lxc.net.0.type = veth |
2856 | lxc.net.0.flags = up | |
2857 | lxc.net.0.link = br0 | |
2858 | lxc.net.0.name = eth0 | |
2859 | lxc.net.0.hwaddr = 4a:49:43:49:79:bf | |
e71b47b2 KY |
2860 | lxc.net.0.ipv4.address = 1.2.3.5/24 1.2.3.255 |
2861 | lxc.net.0.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3597 | |
fb261f53 KY |
2862 | </programlisting> |
2863 | </refsect2> | |
2864 | ||
2865 | <refsect2> | |
2866 | <title><!-- UID/GID mapping -->UID/GID のマッピング</title> | |
2867 | <para><!-- This configuration will map both user and group ids in the | |
2868 | range 0-9999 in the container to the ids 100000-109999 on the host. --> | |
dc421f3a | 2869 | この設定は、コンテナ内のユーザとグループ両方の id 0-9999 の範囲を、ホスト上の 100000-109999 へマッピングします。 |
fb261f53 KY |
2870 | </para> |
2871 | <programlisting> | |
bdcbb6b3 CB |
2872 | lxc.idmap = u 0 100000 10000 |
2873 | lxc.idmap = g 0 100000 10000 | |
fb261f53 KY |
2874 | </programlisting> |
2875 | </refsect2> | |
2876 | ||
2877 | <refsect2> | |
2878 | <title>Control group</title> | |
2879 | <para> | |
2880 | <!-- This configuration will setup several control groups for | |
2881 | the application, cpuset.cpus restricts usage of the defined cpu, | |
2882 | cpus.share prioritize the control group, devices.allow makes | |
2883 | usable the specified devices.--> | |
dc421f3a KY |
2884 | この設定は、アプリケーションのための control group をいくつか設定します。 |
2885 | cpuset.cpus は定義された cpu のみ使用できるように制限します。 | |
2886 | cpus.share は、control group の (cpu) 優先度を指定します。 | |
2887 | devices.allow は、特定のデバイスを使用可能にします。 | |
fb261f53 KY |
2888 | </para> |
2889 | <programlisting> | |
50a8555e KY |
2890 | lxc.cgroup.cpuset.cpus = 0,1 |
2891 | lxc.cgroup.cpu.shares = 1234 | |
2892 | lxc.cgroup.devices.deny = a | |
2893 | lxc.cgroup.devices.allow = c 1:3 rw | |
2894 | lxc.cgroup.devices.allow = b 8:0 rw | |
fb261f53 KY |
2895 | </programlisting> |
2896 | </refsect2> | |
2897 | ||
2898 | <refsect2> | |
2899 | <title><!-- Complex configuration -->複雑な設定</title> | |
2900 | <para> | |
2901 | <!-- This example show a complex configuration making a complex | |
2902 | network stack, using the control groups, setting a new hostname, | |
2903 | mounting some locations and a changing root file system. --> | |
dc421f3a | 2904 | この例は、control group を使って、複雑なネットワークスタックを作成し、新しいホスト名を指定し、いくつかの場所をマウントし、ルートファイルシステムを変更するような複雑な設定を示します。 |
fb261f53 KY |
2905 | </para> |
2906 | <programlisting> | |
b67771bc | 2907 | lxc.uts.name = complex |
7fa3f2e9 | 2908 | lxc.net.0.type = veth |
2909 | lxc.net.0.flags = up | |
2910 | lxc.net.0.link = br0 | |
2911 | lxc.net.0.hwaddr = 4a:49:43:49:79:bf | |
e71b47b2 KY |
2912 | lxc.net.0.ipv4.address = 10.2.3.5/24 10.2.3.255 |
2913 | lxc.net.0.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3597 | |
2914 | lxc.net.0.ipv6.address = 2003:db8:1:0:214:5432:feab:3588 | |
7fa3f2e9 | 2915 | lxc.net.1.type = macvlan |
2916 | lxc.net.1.flags = up | |
2917 | lxc.net.1.link = eth0 | |
2918 | lxc.net.1.hwaddr = 4a:49:43:49:79:bd | |
e71b47b2 KY |
2919 | lxc.net.1.ipv4.address = 10.2.3.4/24 |
2920 | lxc.net.1.ipv4.address = 192.168.10.125/24 | |
2921 | lxc.net.1.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3596 | |
7fa3f2e9 | 2922 | lxc.net.2.type = phys |
2923 | lxc.net.2.flags = up | |
2924 | lxc.net.2.link = dummy0 | |
2925 | lxc.net.2.hwaddr = 4a:49:43:49:79:ff | |
e71b47b2 KY |
2926 | lxc.net.2.ipv4.address = 10.2.3.6/24 |
2927 | lxc.net.2.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3297 | |
2513f519 KY |
2928 | lxc.cgroup.cpuset.cpus = 0,1 |
2929 | lxc.cgroup.cpu.shares = 1234 | |
2930 | lxc.cgroup.devices.deny = a | |
2931 | lxc.cgroup.devices.allow = c 1:3 rw | |
2932 | lxc.cgroup.devices.allow = b 8:0 rw | |
e71b47b2 | 2933 | lxc.mount.fstab = /etc/fstab.complex |
2513f519 | 2934 | lxc.mount.entry = /lib /root/myrootfs/lib none ro,bind 0 0 |
a64f3157 | 2935 | lxc.rootfs.path = dir:/mnt/rootfs.complex |
2513f519 KY |
2936 | lxc.cap.drop = sys_module mknod setuid net_raw |
2937 | lxc.cap.drop = mac_override | |
fb261f53 KY |
2938 | </programlisting> |
2939 | </refsect2> | |
2940 | ||
2941 | </refsect1> | |
2942 | ||
2943 | <refsect1> | |
2944 | <title>See Also</title> | |
2945 | <simpara> | |
2946 | <citerefentry> | |
50a8555e KY |
2947 | <refentrytitle><command>chroot</command></refentrytitle> |
2948 | <manvolnum>1</manvolnum> | |
fb261f53 KY |
2949 | </citerefentry>, |
2950 | ||
2951 | <citerefentry> | |
50a8555e KY |
2952 | <refentrytitle><command>pivot_root</command></refentrytitle> |
2953 | <manvolnum>8</manvolnum> | |
fb261f53 KY |
2954 | </citerefentry>, |
2955 | ||
2956 | <citerefentry> | |
50a8555e KY |
2957 | <refentrytitle><filename>fstab</filename></refentrytitle> |
2958 | <manvolnum>5</manvolnum> | |
fb261f53 KY |
2959 | </citerefentry> |
2960 | ||
2961 | <citerefentry> | |
50a8555e KY |
2962 | <refentrytitle><filename>capabilities</filename></refentrytitle> |
2963 | <manvolnum>7</manvolnum> | |
fb261f53 KY |
2964 | </citerefentry> |
2965 | ||
2966 | </simpara> | |
2967 | </refsect1> | |
2968 | ||
2969 | &seealso; | |
2970 | ||
2971 | <refsect1> | |
2972 | <title><!-- Author -->作者</title> | |
2973 | <para>Daniel Lezcano <email>daniel.lezcano@free.fr</email></para> | |
2974 | </refsect1> | |
2975 | ||
2976 | </refentry> | |
2977 | ||
2978 | <!-- Keep this comment at the end of the file | |
2979 | Local variables: | |
2980 | mode: sgml | |
2981 | sgml-omittag:t | |
2982 | sgml-shorttag:t | |
2983 | sgml-minimize-attributes:nil | |
2984 | sgml-always-quote-attributes:t | |
2985 | sgml-indent-step:2 | |
2986 | sgml-indent-data:t | |
2987 | sgml-parent-document:nil | |
2988 | sgml-default-dtd-file:nil | |
2989 | sgml-exposed-tags:nil | |
2990 | sgml-local-catalogs:nil | |
2991 | sgml-local-ecat-files:nil | |
2992 | End: | |
2993 | --> |