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