]>
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 | <!-- | |
59 | The linux containers (<command>lxc</command>) are always created | |
60 | before being used. This creation defines a set of system | |
61 | resources to be virtualized / isolated when a process is using | |
62 | the container. By default, the pids, sysv ipc and mount points | |
63 | are virtualized and isolated. The other system resources are | |
64 | shared across containers, until they are explicitly defined in | |
65 | the configuration file. For example, if there is no network | |
66 | configuration, the network will be shared between the creator of | |
67 | the container and the container itself, but if the network is | |
68 | specified, a new network stack is created for the container and | |
69 | the container can no longer use the network of its ancestor. | |
70 | --> | |
dc421f3a KY |
71 | linux コンテナ (<command>lxc</command>) は、常に使用する前に作成されます。 |
72 | コンテナは、プロセスがコンテナを使う時に仮想化/隔離するシステムリソースのセットを定義することによって作成します。 | |
73 | デフォルトでは、pid, sysv ipc, マウントポイントが仮想化され、隔離されます。 | |
74 | 他のシステムリソースは、設定ファイルで明確に定義されない限りは、コンテナをまたいで共有されます。 | |
75 | 例えば、もしネットワークが設定されていなければ、コンテナを作成する側とコンテナでネットワークを共有します。 | |
76 | しかし、ネットワークが指定されれば、新しいネットワークスタックがコンテナ用に作成され、コンテナは作成元の環境のネットワークを使いません。 | |
fb261f53 KY |
77 | </para> |
78 | ||
79 | <para> | |
80 | <!-- | |
81 | The configuration file defines the different system resources to | |
82 | be assigned for the container. At present, the utsname, the | |
83 | network, the mount points, the root file system, the user namespace, | |
84 | and the control groups are supported. | |
85 | --> | |
dc421f3a KY |
86 | 設定ファイルは、コンテナに割り当てられる様々なシステムリソースを定義します。 |
87 | 現時点では、utsname、ネットワーク、マウントポイント、root ファイルシステム、ユーザ名前空間、control groups がサポートされます。 | |
fb261f53 KY |
88 | </para> |
89 | ||
90 | <para> | |
91 | <!-- | |
92 | Each option in the configuration file has the form <command>key | |
93 | = value</command> fitting in one line. The '#' character means | |
94 | the line is a comment. | |
95 | --> | |
dc421f3a KY |
96 | 設定ファイルのオプション一つを、<command>key = value</command> の形で一行で表します。 |
97 | '#' は、その行はコメントであることを示します。 | |
fb261f53 KY |
98 | </para> |
99 | ||
100 | <refsect2> | |
101 | <title><!-- Configuration -->設定</title> | |
102 | <para> | |
103 | <!-- | |
104 | In order to ease administration of multiple related containers, it | |
105 | is possible to have a container configuration file cause another | |
106 | file to be loaded. For instance, network configuration | |
107 | can be defined in one common file which is included by multiple | |
108 | containers. Then, if the containers are moved to another host, | |
109 | only one file may need to be updated. | |
110 | --> | |
dc421f3a KY |
111 | 複数の関係するコンテナの管理を容易にするために、コンテナの設定ファイルに別のファイルをロードすることが可能です。 |
112 | 例えば、ネットワークの設定を、複数のコンテナから include させるように 1 つのファイルに定義することが可能です。 | |
113 | その場合、コンテナが他のホストに移動すると、そのファイルだけを更新する必要があるかもしれません。 | |
fb261f53 KY |
114 | </para> |
115 | ||
116 | <variablelist> | |
117 | <varlistentry> | |
118 | <term> | |
119 | <option>lxc.include</option> | |
120 | </term> | |
121 | <listitem> | |
122 | <para> | |
123 | <!-- | |
124 | Specify the file to be included. The included file must be | |
125 | in the same valid lxc configuration file format. | |
126 | --> | |
dc421f3a KY |
127 | include させたいファイルを指定します。 |
128 | include するファイルは、lxc 設定ファイルのフォーマットとして有効でなければいけません。 | |
fb261f53 KY |
129 | </para> |
130 | </listitem> | |
131 | </varlistentry> | |
132 | </variablelist> | |
133 | </refsect2> | |
134 | ||
135 | <refsect2> | |
136 | <title><!-- Architecture -->アーキテクチャ</title> | |
137 | <para> | |
138 | <!-- | |
139 | Allows one to set the architecture for the container. For example, | |
140 | set a 32bits architecture for a container running 32bits | |
141 | binaries on a 64bits host. That fixes the container scripts | |
142 | which rely on the architecture to do some work like | |
143 | downloading the packages. | |
144 | --> | |
dc421f3a KY |
145 | コンテナに対してアーキテクチャを設定することが可能です。 |
146 | 例えば、64 ビットのホスト上で 32 ビットのバイナリを動かすために 32 ビットアーキテクチャを設定することが可能です。 | |
147 | この設定を行うことにより、パッケージのダウンロードを行うなどの作業のうち、アーキテクチャ名に依存するような作業を行うコンテナスクリプトの修正を行います。 | |
fb261f53 KY |
148 | </para> |
149 | ||
150 | <variablelist> | |
151 | <varlistentry> | |
152 | <term> | |
153 | <option>lxc.arch</option> | |
154 | </term> | |
155 | <listitem> | |
156 | <para> | |
157 | <!-- | |
158 | Specify the architecture for the container. | |
159 | --> | |
dc421f3a | 160 | コンテナに設定するアーキテクチャを指定します。 |
fb261f53 KY |
161 | </para> |
162 | <para> | |
163 | <!-- | |
164 | Valid options are | |
165 | <option>x86</option>, | |
166 | <option>i686</option>, | |
167 | <option>x86_64</option>, | |
168 | <option>amd64</option> | |
169 | --> | |
dc421f3a | 170 | 有効なオプションは以下です。 |
fb261f53 KY |
171 | <option>x86</option>, |
172 | <option>i686</option>, | |
173 | <option>x86_64</option>, | |
174 | <option>amd64</option> | |
175 | </para> | |
176 | </listitem> | |
177 | </varlistentry> | |
178 | </variablelist> | |
179 | ||
180 | </refsect2> | |
181 | ||
182 | <refsect2> | |
183 | <title><!-- Hostname -->ホスト名</title> | |
184 | <para> | |
185 | <!-- | |
186 | The utsname section defines the hostname to be set for the | |
187 | container. That means the container can set its own hostname | |
188 | without changing the one from the system. That makes the | |
189 | hostname private for the container. | |
190 | --> | |
dc421f3a KY |
191 | utsname セクションは、コンテナに設定されるホスト名を定義します。 |
192 | コンテナは、システムのホスト名を変えることなく、自身のホスト名を持つ事が可能です。 | |
193 | このことにより、ホスト名はコンテナ専用となります。 | |
fb261f53 KY |
194 | </para> |
195 | <variablelist> | |
196 | <varlistentry> | |
197 | <term> | |
198 | <option>lxc.utsname</option> | |
199 | </term> | |
200 | <listitem> | |
201 | <para> | |
202 | <!-- | |
203 | specify the hostname for the container | |
204 | --> | |
dc421f3a | 205 | コンテナのホスト名を指定します。 |
fb261f53 KY |
206 | </para> |
207 | </listitem> | |
208 | </varlistentry> | |
209 | </variablelist> | |
210 | </refsect2> | |
211 | ||
212 | <refsect2> | |
213 | <title><!-- Halt signal -->クリーンなシャットダウン時のシグナル</title> | |
214 | <para> | |
215 | <!-- | |
216 | Allows one to specify signal name or number, sent by lxc-stop to the | |
217 | container's init process to cleanly shutdown the container. Different | |
218 | init systems could use different signals to perform clean shutdown | |
219 | sequence. This option allows the signal to be specified in kill(1) | |
220 | fashion, e.g. SIGPWR, SIGRTMIN+14, SIGRTMAX-10 or plain number. The | |
221 | default signal is SIGPWR. | |
222 | --> | |
dc421f3a KY |
223 | lxc-stop がコンテナをクリーンにシャットダウンするためにコンテナの init プロセスに送るシグナル名か番号を指定することができます。 |
224 | init システムによって、クリーンなシャットダウンを行うために使うシグナルは異なります。 | |
225 | このオプションではシグナルとして kill(1) で使う形式を指定することができます。 | |
226 | 例えば SIGKILL, SIGRTMIN+14, SIGRTMAX-10 のような形式、もしくは数字を指定します。デフォルトのシグナルは SIGPWR です。 | |
fb261f53 KY |
227 | </para> |
228 | <variablelist> | |
229 | <varlistentry> | |
230 | <term> | |
231 | <option>lxc.haltsignal</option> | |
232 | </term> | |
233 | <listitem> | |
234 | <para> | |
235 | <!-- | |
236 | specify the signal used to halt the container | |
237 | --> | |
238 | コンテナをシャットダウンするのに使うシグナルを指定します | |
239 | </para> | |
240 | </listitem> | |
241 | </varlistentry> | |
242 | </variablelist> | |
243 | </refsect2> | |
244 | ||
245 | <refsect2> | |
246 | <title><!-- Stop signal -->強制停止時のシグナル</title> | |
247 | <para> | |
248 | <!-- | |
249 | Allows one to specify signal name or number, sent by lxc-stop to forcibly | |
250 | shutdown the container. This option allows signal to be specified in | |
251 | kill(1) fashion, e.g. SIGKILL, SIGRTMIN+14, SIGRTMAX-10 or plain number. | |
252 | The default signal is SIGKILL. | |
253 | --> | |
dc421f3a KY |
254 | lxc-stop がコンテナを強制的にシャットダウンするために送るシグナル名か番号を指定することができます。 |
255 | このオプションではシグナルとして kill(1) で使う形式を指定することができます。 | |
256 | 例えば SIGKILL, SIGRTMIN+14, SIGRTMAX-10 のような形式、もしくは数字を指定します。デフォルトのシグナルは SIGKILL です。 | |
fb261f53 KY |
257 | </para> |
258 | <variablelist> | |
259 | <varlistentry> | |
260 | <term> | |
261 | <option>lxc.stopsignal</option> | |
262 | </term> | |
263 | <listitem> | |
264 | <para> | |
265 | <!-- | |
266 | specify the signal used to stop the container | |
267 | --> | |
dc421f3a | 268 | コンテナを停止するのに使用するシグナルを指定します。 |
fb261f53 KY |
269 | </para> |
270 | </listitem> | |
271 | </varlistentry> | |
272 | </variablelist> | |
273 | </refsect2> | |
274 | ||
275 | <refsect2> | |
276 | <title><!-- Network -->ネットワーク</title> | |
277 | <para> | |
278 | <!-- | |
279 | The network section defines how the network is virtualized in | |
280 | the container. The network virtualization acts at layer | |
281 | two. In order to use the network virtualization, parameters | |
282 | must be specified to define the network interfaces of the | |
283 | container. Several virtual interfaces can be assigned and used | |
284 | in a container even if the system has only one physical | |
285 | network interface. | |
286 | --> | |
dc421f3a KY |
287 | ネットワークセクションは、コンテナ内でどのようにネットワークを仮想化するかを定義します。 |
288 | ネットワークの仮想化はレイヤー 2 で作動します。 | |
289 | ネットワークの仮想化を使用するためには、コンテナのネットワークインターフェースを定義しなければなりません。 | |
290 | いくつかの仮想インターフェースをアサインすることができます。 | |
291 | そして、仮に物理ネットワークインターフェースが一つしかなくても、コンテナ内でいくつもの仮想インターフェースを使うことができます。 | |
fb261f53 KY |
292 | </para> |
293 | <variablelist> | |
294 | <varlistentry> | |
295 | <term> | |
296 | <option>lxc.network.type</option> | |
297 | </term> | |
298 | <listitem> | |
299 | <para> | |
300 | <!-- | |
301 | specify what kind of network virtualization to be used | |
302 | for the container. Each time | |
303 | a <option>lxc.network.type</option> field is found a new | |
304 | round of network configuration begins. In this way, | |
305 | several network virtualization types can be specified | |
306 | for the same container, as well as assigning several | |
307 | network interfaces for one container. The different | |
308 | virtualization types can sbe: | |
309 | --> | |
dc421f3a KY |
310 | コンテナがどの種類のネットワーク仮想化を使うかを指定します。 |
311 | 一つのネットワークの設定ごとに <option>lxc.network.type</option> フィールドを指定します。 | |
312 | このように、一つのコンテナに複数のネットワークインターフェースを割り当てることができるだけでなく、同じコンテナに対して複数のネットワーク仮想化の種類を指定することが出来ます。 | |
fb261f53 KY |
313 | 仮想化の種類は以下の値を取る事が出来ます: |
314 | </para> | |
315 | ||
316 | <para> | |
317 | <!-- | |
318 | <option>none:</option> will cause the container to share | |
319 | the host's network namespace. This means the host | |
320 | network devices are usable in the container. It also | |
321 | means that if both the container and host have upstart as | |
322 | init, 'halt' in a container (for instance) will shut down the | |
323 | host. | |
324 | --> | |
dc421f3a KY |
325 | <option>none:</option> ホストのネットワーク名前空間を共有します。 |
326 | これにより、ホストのネットワークデバイスをコンテナ内で使うことが可能になります。 | |
327 | もしコンテナもホストも init として upstart を使っている場合、(例えば) コンテナ内で 'halt' を実行すると、ホストがシャットダウンしてしまうことにもなります。 | |
fb261f53 KY |
328 | </para> |
329 | ||
330 | <para> | |
331 | <!-- | |
332 | <option>empty:</option> will create only the loopback | |
333 | interface. | |
334 | --> | |
dc421f3a | 335 | <option>empty:</option> ループバックインターフェースだけを作成します。 |
fb261f53 KY |
336 | </para> |
337 | ||
338 | <para> | |
339 | <!-- | |
340 | <option>veth:</option> a peer network device is created | |
341 | with one side assigned to the container and the other | |
342 | side is attached to a bridge specified by | |
343 | the <option>lxc.network.link</option>. If the bridge is | |
344 | not specified, then the veth pair device will be created | |
345 | but not attached to any bridge. Otherwise, the bridge | |
346 | has to be setup before on the | |
347 | system, <command>lxc</command> won't handle any | |
348 | configuration outside of the container. By | |
349 | default <command>lxc</command> choose a name for the | |
350 | network device belonging to the outside of the | |
351 | container, this name is handled | |
352 | by <command>lxc</command>, but if you wish to handle | |
353 | this name yourself, you can tell <command>lxc</command> | |
354 | to set a specific name with | |
355 | the <option>lxc.network.veth.pair</option> option. | |
356 | --> | |
dc421f3a KY |
357 | <option>veth:</option> 一方がコンテナに、もう一方が <option>lxc.network.link</option> で指定されるブリッジにアタッチされる、ピアネットワークデバイスを作成します。 |
358 | もし、ブリッジが指定されていない場合、veth ペアデバイスは作成されますが、ブリッジにはアタッチされません。 | |
359 | ブリッジはシステムで事前に設定する必要があります。 | |
360 | さもなければ、<command>lxc</command> はコンテナ外のいかなる設定も扱うことはできないでしょう。 | |
361 | デフォルトでは、<command>lxc</command> はコンテナの外部に属するネットワークデバイスに対する名前を決定し、<command>lxc</command> はこの名前を使います。 | |
362 | しかし、もしこの名前を自分で指定したい場合、<option>lxc.network.veth.pair</option> オプションを使って名前を設定し、lxc に対して指定をすることができます。 | |
fb261f53 KY |
363 | </para> |
364 | ||
365 | <para> | |
366 | <!-- | |
367 | <option>vlan:</option> a vlan interface is linked with | |
368 | the interface specified by | |
369 | the <option>lxc.network.link</option> and assigned to | |
370 | the container. The vlan identifier is specified with the | |
371 | option <option>lxc.network.vlan.id</option>. | |
372 | --> | |
dc421f3a KY |
373 | <option>vlan:</option> vlan インターフェースは <option>lxc.network.link</option> で指定されたインターフェースとリンクし、コンテナに割り当てられます。 |
374 | vlan の指定は <option>lxc.network.vlan.id</option> オプションで指定します。 | |
fb261f53 KY |
375 | </para> |
376 | ||
377 | <para> | |
378 | <!-- | |
379 | <option>macvlan:</option> a macvlan interface is linked | |
380 | with the interface specified by | |
381 | the <option>lxc.network.link</option> and assigned to | |
382 | the container. | |
383 | <option>lxc.network.macvlan.mode</option> specifies the | |
384 | mode the macvlan will use to communicate between | |
385 | different macvlan on the same upper device. The accepted | |
386 | modes are <option>private</option>, the device never | |
387 | communicates with any other device on the same upper_dev (default), | |
388 | <option>vepa</option>, the new Virtual Ethernet Port | |
389 | Aggregator (VEPA) mode, it assumes that the adjacent | |
390 | bridge returns all frames where both source and | |
391 | destination are local to the macvlan port, i.e. the | |
392 | bridge is set up as a reflective relay. Broadcast | |
393 | frames coming in from the upper_dev get flooded to all | |
394 | macvlan interfaces in VEPA mode, local frames are not | |
395 | delivered locally, or <option>bridge</option>, it | |
396 | provides the behavior of a simple bridge between | |
397 | different macvlan interfaces on the same port. Frames | |
398 | from one interface to another one get delivered directly | |
399 | and are not sent out externally. Broadcast frames get | |
400 | flooded to all other bridge ports and to the external | |
401 | interface, but when they come back from a reflective | |
402 | relay, we don't deliver them again. Since we know all | |
403 | the MAC addresses, the macvlan bridge mode does not | |
404 | require learning or STP like the bridge module does. | |
405 | --> | |
dc421f3a KY |
406 | <option>macvlan:</option> macvlan インターフェースは <option>lxc.network.link</option> により指定されるインターフェースとリンクし、コンテナに割り当てられます。 |
407 | <option>lxc.network.macvlan.mode</option> でモードを指定すると、その macvlan の指定を、同じ上位デバイスで異なる macvlan の間の通信をする時に使います。 | |
408 | 受け入れられたモードが <option>private</option> であれば、デバイスは同じ上位デバイスの他のデバイスとの通信を行いません (デフォルト)。 | |
409 | 新しい仮想イーサネットポート集約モード (Virtual Ethernet Port Aggregator (VEPA)) である <option>vepa</option> は、隣接したポートが、ソースとデスティネーションの両方が macvlan ポートに対してローカルであるフレームを全て返すと仮定します。 | |
410 | すなわち、ブリッジが reflective relay として設定されているということです。 | |
411 | 上位デバイスから入ってくるブロードキャストフレームは、VEPA モードである全ての macvlan インターフェースに送りつけられます。 | |
412 | ローカルのフレームはローカルには配送されません。 | |
413 | <option>bridge</option> の指定は、同じポートの異なる macvlan インターフェースの間のシンプルなブリッジとして動作します。 | |
414 | あるインターフェースから他のインターフェースへのフレームは、直接配送され、外部には送出されません。 | |
415 | ブロードキャストフレームは、全ての他のブリッジと外部のインターフェースに対して送られます。 | |
416 | しかし、reflective relay からフレームが返ってきたときは、再度それを配送することはしません。 | |
417 | 全ての MAC アドレスを知っているので、ブリッジモジュールのように、macvlan ブリッジモードは学習や STP の必要はありません。 | |
fb261f53 KY |
418 | </para> |
419 | ||
420 | <para> | |
421 | <!-- | |
422 | <option>phys:</option> an already existing interface | |
423 | specified by the <option>lxc.network.link</option> is | |
424 | assigned to the container. | |
425 | --> | |
dc421f3a | 426 | <option>phys:</option> <option>lxc.network.link</option> で指定された、すでに存在しているインターフェースがコンテナに割り当てられます。 |
fb261f53 KY |
427 | </para> |
428 | </listitem> | |
429 | </varlistentry> | |
430 | ||
431 | <varlistentry> | |
432 | <term> | |
433 | <option>lxc.network.flags</option> | |
434 | </term> | |
435 | <listitem> | |
436 | <para> | |
437 | <!-- | |
438 | specify an action to do for the | |
439 | network. | |
440 | --> | |
dc421f3a | 441 | ネットワークに対して行うアクションを指定します。 |
fb261f53 KY |
442 | </para> |
443 | ||
444 | <para> | |
445 | <!-- | |
446 | <option>up:</option> activates the interface. | |
447 | --> | |
dc421f3a | 448 | <option>up:</option> インターフェースを起動させます。 |
fb261f53 KY |
449 | </para> |
450 | </listitem> | |
451 | </varlistentry> | |
452 | ||
453 | <varlistentry> | |
454 | <term> | |
455 | <option>lxc.network.link</option> | |
456 | </term> | |
457 | <listitem> | |
458 | <para> | |
459 | <!-- | |
460 | specify the interface to be used for real network | |
461 | traffic. | |
462 | --> | |
dc421f3a | 463 | 実際のネットワークトラフィックに使うインターフェースを指定します。 |
fb261f53 KY |
464 | </para> |
465 | </listitem> | |
466 | </varlistentry> | |
467 | ||
468 | <varlistentry> | |
469 | <term> | |
470 | <option>lxc.network.mtu</option> | |
471 | </term> | |
472 | <listitem> | |
473 | <para> | |
474 | <!-- | |
475 | specify the maximum transfer unit for this interface. | |
476 | --> | |
dc421f3a | 477 | インターフェースに対する MTU を指定します。 |
fb261f53 KY |
478 | </para> |
479 | </listitem> | |
480 | </varlistentry> | |
481 | ||
482 | <varlistentry> | |
483 | <term> | |
484 | <option>lxc.network.name</option> | |
485 | </term> | |
486 | <listitem> | |
487 | <para> | |
488 | <!-- | |
489 | the interface name is dynamically allocated, but if | |
490 | another name is needed because the configuration files | |
491 | being used by the container use a generic name, | |
492 | eg. eth0, this option will rename the interface in the | |
493 | container. | |
494 | --> | |
dc421f3a KY |
495 | インターフェース名は動的に割り当てられます。 |
496 | しかし、もしコンテナが使用する設定ファイルが一般的な名前を使用するために、他の特定の名前が必要であれば (例えば eth0 など)、コンテナ内のインターフェースは、このオプションで指定した名前にリネームされます。 | |
fb261f53 KY |
497 | </para> |
498 | </listitem> | |
499 | </varlistentry> | |
500 | ||
501 | <varlistentry> | |
502 | <term> | |
503 | <option>lxc.network.hwaddr</option> | |
504 | </term> | |
505 | <listitem> | |
506 | <para> | |
507 | <!-- | |
508 | the interface mac address is dynamically allocated by | |
509 | default to the virtual interface, but in some cases, | |
510 | this is needed to resolve a mac address conflict or to | |
511 | always have the same link-local ipv6 address. | |
512 | Any "x" in address will be replaced by random value, | |
513 | this allows setting hwaddr templates. | |
514 | --> | |
dc421f3a KY |
515 | 仮想インターフェースの MAC アドレスは、デフォルトでは動的に割り当てられます。 |
516 | しかし、MAC アドレスの衝突や、リンクローカルIPv6 アドレスを常に同じにした場合などは、このオプションが必要です。 | |
517 | アドレス中の "x" という文字は、ランダムな値に置き換えられます。 | |
518 | これによりテンプレートに hwaddr を設定することが可能になります。 | |
fb261f53 KY |
519 | </para> |
520 | </listitem> | |
521 | </varlistentry> | |
522 | ||
523 | <varlistentry> | |
524 | <term> | |
525 | <option>lxc.network.ipv4</option> | |
526 | </term> | |
527 | <listitem> | |
528 | <para> | |
529 | <!-- | |
530 | specify the ipv4 address to assign to the virtualized | |
531 | interface. Several lines specify several ipv4 addresses. | |
532 | The address is in format x.y.z.t/m, | |
533 | eg. 192.168.1.123/24.The broadcast address should be | |
534 | specified on the same line, right after the ipv4 | |
535 | address. | |
536 | --> | |
dc421f3a KY |
537 | 仮想インターフェースに割り当てる ipv4 アドレスを指定します。 |
538 | 複数行により複数の ipv4 アドレスを指定します。 | |
539 | このアドレスは x.y.z.t/m というフォーマットで指定します。 | |
540 | 例えば、192.168.1.123/24。ブロードキャストアドレスも同じ行の ipv4 アドレスのすぐ後で指定しなくてはなりません。 | |
fb261f53 KY |
541 | </para> |
542 | </listitem> | |
543 | </varlistentry> | |
544 | ||
545 | <varlistentry> | |
546 | <term> | |
547 | <option>lxc.network.ipv4.gateway</option> | |
548 | </term> | |
549 | <listitem> | |
550 | <para> | |
551 | <!-- | |
552 | specify the ipv4 address to use as the gateway inside the | |
553 | container. The address is in format x.y.z.t, eg. | |
554 | 192.168.1.123. | |
555 | ||
556 | Can also have the special value <option>auto</option>, | |
557 | which means to take the primary address from the bridge | |
558 | interface (as specified by the | |
559 | <option>lxc.network.link</option> option) and use that as | |
560 | the gateway. <option>auto</option> is only available when | |
561 | using the <option>veth</option> and | |
562 | <option>macvlan</option> network types. | |
563 | --> | |
dc421f3a KY |
564 | コンテナでゲートウェイとして使う IPv4 アドレスを指定します。 |
565 | アドレスは x.y.z.t というフォーマットです。 | |
566 | 例えば、192.168.1.123。 | |
fb261f53 | 567 | |
dc421f3a KY |
568 | <option>auto</option> という特別な値を記述する事も可能です。 |
569 | これは (<option>lxc.network.link</option> で指定した) ブリッジインターフェースの最初のアドレスを使用し、それをゲートウェイに使うという意味になります。 | |
570 | <option>auto</option> はネットワークタイプとして <option>veth</option> と <option>macvlan</option> を指定している時だけ有効となります。 | |
fb261f53 KY |
571 | </para> |
572 | </listitem> | |
573 | </varlistentry> | |
574 | ||
575 | ||
576 | <varlistentry> | |
577 | <term> | |
578 | <option>lxc.network.ipv6</option> | |
579 | </term> | |
580 | <listitem> | |
581 | <para> | |
582 | <!-- | |
583 | specify the ipv6 address to assign to the virtualized | |
584 | interface. Several lines specify several ipv6 addresses. | |
585 | The address is in format x::y/m, | |
586 | eg. 2003:db8:1:0:214:1234:fe0b:3596/64 | |
587 | --> | |
dc421f3a KY |
588 | 仮想インターフェースに割り当てる ipv6 アドレスを指定します。 |
589 | 複数行により複数の ipv6 アドレスを指定します。 | |
590 | このアドレスは x::y/m というフォーマットで指定します。 | |
591 | 例えば、2003:db8:1:0:214:1234:fe0b:3596/64。 | |
fb261f53 KY |
592 | </para> |
593 | </listitem> | |
594 | </varlistentry> | |
595 | ||
596 | <varlistentry> | |
597 | <term> | |
598 | <option>lxc.network.ipv6.gateway</option> | |
599 | </term> | |
600 | <listitem> | |
601 | <para> | |
602 | <!-- | |
603 | specify the ipv6 address to use as the gateway inside the | |
604 | container. The address is in format x::y, | |
605 | eg. 2003:db8:1:0::1 | |
606 | ||
607 | Can also have the special value <option>auto</option>, | |
608 | which means to take the primary address from the bridge | |
609 | interface (as specified by the | |
610 | <option>lxc.network.link</option> option) and use that as | |
611 | the gateway. <option>auto</option> is only available when | |
612 | using the <option>veth</option> and | |
613 | <option>macvlan</option> network types. | |
614 | --> | |
dc421f3a KY |
615 | コンテナでゲートウェイとして使う IPv6 アドレスを指定します。 |
616 | アドレスは x::y というフォーマットです。例えば、2003:db8:1:0::1。 | |
fb261f53 | 617 | |
dc421f3a KY |
618 | <option>auto</option> という特別な値を記述する事も可能です。 |
619 | これは (<option>lxc.network.link</option> で指定した) ブリッジインターフェースの最初のアドレスを使用し、それをゲートウェイに使うという意味になります。 | |
620 | <option>auto</option> はネットワークタイプとして <option>veth</option> と <option>macvlan</option> を指定している時だけ有効となります。 | |
fb261f53 KY |
621 | </para> |
622 | </listitem> | |
623 | </varlistentry> | |
624 | ||
625 | <varlistentry> | |
626 | <term> | |
627 | <option>lxc.network.script.up</option> | |
628 | </term> | |
629 | <listitem> | |
630 | <para> | |
631 | <!-- | |
632 | add a configuration option to specify a script to be | |
633 | executed after creating and configuring the network used | |
634 | from the host side. The following arguments are passed | |
635 | to the script: container name and config section name | |
636 | (net) Additional arguments depend on the config section | |
637 | employing a script hook; the following are used by the | |
638 | network system: execution context (up), network type | |
639 | (empty/veth/macvlan/phys), Depending on the network | |
640 | type, other arguments may be passed: | |
641 | veth/macvlan/phys. And finally (host-sided) device name. | |
642 | --> | |
dc421f3a KY |
643 | ホスト側から使われる、ネットワークの作成と設定が済んだ後に実行するスクリプトを指定します。 |
644 | 以下の引数がスクリプトに渡されます: コンテナ名、設定セクション名(net)。 | |
645 | その後の引数はスクリプトのフックで使われる設定セクションに依存します。 | |
646 | 以下がネットワークシステムによって使われます: 実行コンテキスト (up)、ネットワークのタイプ (empty/veth/macvlan/phys) | |
647 | ネットワークのタイプによっては、更に別の引数が渡されるかもしれません: veth/macvlan/phys の場合 (ホスト側の) デバイス名 | |
fb261f53 KY |
648 | </para> |
649 | <para> | |
650 | <!-- | |
651 | Standard output from the script is logged at debug level. | |
652 | Standard error is not logged, but can be captured by the | |
653 | hook redirecting its standard error to standard output. | |
654 | --> | |
dc421f3a KY |
655 | スクリプトからの標準出力は debug レベルでロギングされます。 |
656 | 標準エラー出力はロギングされません。 | |
657 | しかし、フックの標準エラー出力を標準出力にリダイレクトすることにより保存することは可能です。 | |
fb261f53 KY |
658 | </para> |
659 | </listitem> | |
660 | </varlistentry> | |
661 | ||
662 | <varlistentry> | |
663 | <term> | |
664 | <option>lxc.network.script.down</option> | |
665 | </term> | |
666 | <listitem> | |
667 | <para> | |
668 | <!-- | |
669 | add a configuration option to specify a script to be | |
670 | executed before destroying the network used from the | |
671 | host side. The following arguments are passed to the | |
672 | script: container name and config section name (net) | |
673 | Additional arguments depend on the config section | |
674 | employing a script hook; the following are used by the | |
675 | network system: execution context (down), network type | |
676 | (empty/veth/macvlan/phys), Depending on the network | |
677 | type, other arguments may be passed: | |
678 | veth/macvlan/phys. And finally (host-sided) device name. | |
679 | --> | |
dc421f3a KY |
680 | ホスト側から使われる、ネットワークを破壊する前に実行するスクリプトを指定します。 |
681 | 以下の引数がスクリプトに渡されます: コンテナ名、設定セクション名(net)。 | |
682 | その後の引数はスクリプトのフックで使われる設定セクションに依存します。 | |
683 | 以下がネットワークシステムによって使われます: 実行コンテキスト (up)、ネットワークのタイプ (empty/veth/macvlan/phys)。 | |
684 | ネットワークのタイプによっては、更に別の引数が渡されるかもしれません: veth/macvlan/phys。そして最後に (ホスト側の) デバイス名が渡されます。 | |
fb261f53 KY |
685 | </para> |
686 | <para> | |
687 | <!-- | |
688 | Standard output from the script is logged at debug level. | |
689 | Standard error is not logged, but can be captured by the | |
690 | hook redirecting its standard error to standard output. | |
691 | --> | |
dc421f3a KY |
692 | スクリプトからの標準出力は debug レベルでロギングされます。 |
693 | 標準エラー出力はロギングされません。 | |
694 | しかし、フックの標準エラー出力を標準出力にリダイレクトすることにより保存することは可能です。 | |
fb261f53 KY |
695 | </para> |
696 | </listitem> | |
697 | </varlistentry> | |
698 | </variablelist> | |
699 | ||
700 | </refsect2> | |
701 | ||
702 | <refsect2> | |
703 | <title><!-- New pseudo tty instance (devpts) -->新しい擬似端末のインスタンス (devpts)</title> | |
704 | <para> | |
705 | <!-- | |
706 | For stricter isolation the container can have its own private | |
707 | instance of the pseudo tty. | |
708 | --> | |
dc421f3a | 709 | さらに厳しい隔離のために、コンテナは自身のプライベートな pseudo tty (擬似端末) を持つことが可能です。 |
fb261f53 KY |
710 | </para> |
711 | <variablelist> | |
712 | <varlistentry> | |
713 | <term> | |
714 | <option>lxc.pts</option> | |
715 | </term> | |
716 | <listitem> | |
717 | <para> | |
718 | <!-- | |
719 | If set, the container will have a new pseudo tty | |
720 | instance, making this private to it. The value specifies | |
721 | the maximum number of pseudo ttys allowed for a pts | |
722 | instance (this limitation is not implemented yet). | |
723 | --> | |
dc421f3a KY |
724 | もし設定された場合、コンテナは新しい psuedo tty インスタンスを持ち、それを自身のプライベートとします。 |
725 | この値は pts インスタンスに許可される pseudo tty の最大数を指定します (この制限はまだ実装されていません)。 | |
fb261f53 KY |
726 | </para> |
727 | </listitem> | |
728 | </varlistentry> | |
729 | </variablelist> | |
730 | </refsect2> | |
731 | ||
732 | <refsect2> | |
733 | <title><!-- Container system console -->コンテナのシステムコンソール</title> | |
734 | <para> | |
735 | <!-- | |
736 | If the container is configured with a root filesystem and the | |
737 | inittab file is setup to use the console, you may want to specify | |
738 | where the output of this console goes. | |
739 | --> | |
dc421f3a | 740 | コンテナでルートファイルシステムを持つように設定されており、inittab ファイルでコンソールの使用が設定されている場合、このコンソールの出力がどこになされるのかを指定したいと思うでしょう。 |
fb261f53 KY |
741 | </para> |
742 | <variablelist> | |
743 | <varlistentry> | |
744 | <term> | |
745 | <option>lxc.console</option> | |
746 | </term> | |
747 | <listitem> | |
748 | <para> | |
749 | <!-- | |
750 | Specify a path to a file where the console output will | |
751 | be written. The keyword 'none' will simply disable the | |
752 | console. This is dangerous once if have a rootfs with a | |
753 | console device file where the application can write, the | |
754 | messages will fall in the host. | |
755 | --> | |
dc421f3a KY |
756 | コンソールの出力が書かれるファイルのパスを指定します。'none' というキーワードは、単純にコンソールを無効にします。 |
757 | この設定は、アプリケーションが書き込む事ができるコンソールデバイスファイルが rootfs に存在する場合、メッセージがホスト側に出力されるので危険です。 | |
fb261f53 KY |
758 | </para> |
759 | </listitem> | |
760 | </varlistentry> | |
761 | </variablelist> | |
762 | </refsect2> | |
763 | ||
764 | <refsect2> | |
765 | <title><!-- Console through the ttys -->tty を通したコンソール</title> | |
766 | <para> | |
767 | <!-- | |
768 | This option is useful if the container is configured with a root | |
769 | filesystem and the inittab file is setup to launch a getty on the | |
770 | ttys. The option specifies the number of ttys to be available for | |
771 | the container. The number of gettys in the inittab file of the | |
772 | container should not be greater than the number of ttys specified | |
773 | in this option, otherwise the excess getty sessions will die and | |
774 | respawn indefinitely giving annoying messages on the console or in | |
775 | <filename>/var/log/messages</filename>. | |
776 | --> | |
dc421f3a KY |
777 | このオプションはコンテナが root ファイルシステムを持つように設定されており、inittab ファイルで tty 上に getty の起動が設定されている場合に役に立ちます。 |
778 | このオプションはコンテナで利用できる tty の数を指定します。 | |
779 | inittab ファイルに設定する getty の数は、このオプションの指定する tty の数より大きくしてはいけません。 | |
780 | さもなければ、超過した分の getty セッションはコンソールか /var/log/messages にうっとうしいメッセージを生死を表示しながら、永久に生死を繰り返すでしょう。 | |
fb261f53 KY |
781 | </para> |
782 | <variablelist> | |
783 | <varlistentry> | |
784 | <term> | |
785 | <option>lxc.tty</option> | |
786 | </term> | |
787 | <listitem> | |
788 | <para> | |
789 | <!-- | |
790 | Specify the number of tty to make available to the | |
791 | container. | |
792 | --> | |
dc421f3a | 793 | コンテナに作成出来る tty の数を指定します。 |
fb261f53 KY |
794 | </para> |
795 | </listitem> | |
796 | </varlistentry> | |
797 | </variablelist> | |
798 | </refsect2> | |
799 | ||
800 | <refsect2> | |
801 | <title><!-- Console devices location -->コンソールデバイスの位置</title> | |
802 | <para> | |
803 | <!-- | |
804 | LXC consoles are provided through Unix98 PTYs created on the | |
805 | host and bind-mounted over the expected devices in the container. | |
806 | By default, they are bind-mounted over <filename>/dev/console</filename> | |
807 | and <filename>/dev/ttyN</filename>. This can prevent package upgrades | |
808 | in the guest. Therefore you can specify a directory location (under | |
809 | <filename>/dev</filename> under which LXC will create the files and | |
810 | bind-mount over them. These will then be symbolically linked to | |
811 | <filename>/dev/console</filename> and <filename>/dev/ttyN</filename>. | |
812 | A package upgrade can then succeed as it is able to remove and replace | |
813 | the symbolic links. | |
814 | --> | |
dc421f3a KY |
815 | LXC のコンソールはホストによって作られ、コンテナ内で要求されたデバイスに bind マウントされた Unix98 PTY 経由で提供されます。 |
816 | デフォルトでは <filename>/dev/console</filename> と <filename>/dev/ttyN</filename> に bind マウントされます。 | |
817 | これはゲスト内でのパッケージのアップグレードを妨げる可能性があります。 | |
818 | なので <filename>/dev</filename> 以下のディレクトリを指定することができます。 | |
819 | LXC はこのディレクトリ以下にファイルを作成し、これらのファイルを bind マウントします。 | |
820 | そして、これらの (作成された) ファイルは <filename>/dev/console</filename> と <filename>/dev/ttyN</filename> にシンボリックリンクされます。 | |
821 | シンボリックリンクを消去したり置き換えたりすることは可能ですから、パッケージのアップグレードは成功します。 | |
fb261f53 KY |
822 | </para> |
823 | <variablelist> | |
824 | <varlistentry> | |
825 | <term> | |
826 | <option>lxc.devttydir</option> | |
827 | </term> | |
828 | <listitem> | |
829 | <para> | |
830 | <!-- | |
831 | Specify a directory under <filename>/dev</filename> | |
832 | under which to create the container console devices. | |
833 | --> | |
dc421f3a | 834 | コンテナのコンソールデバイスを作成するための <filename>/dev</filename> 以下のディレクトリを指定します。 |
fb261f53 KY |
835 | </para> |
836 | </listitem> | |
837 | </varlistentry> | |
838 | </variablelist> | |
839 | </refsect2> | |
840 | ||
841 | <refsect2> | |
842 | <title><!-- /dev directory -->/dev ディレクトリ</title> | |
843 | <para> | |
844 | <!-- | |
95ab9daa KY |
845 | By default, lxc creates a few symbolic links (fd,stdin,stdout,stderr) |
846 | in the container's <filename>/dev</filename> directory but does not | |
847 | automatically create device node entries. This allows the container's | |
fb261f53 KY |
848 | <filename>/dev</filename> to be set up as needed in the container |
849 | rootfs. If lxc.autodev is set to 1, then after mounting the container's | |
850 | rootfs LXC will mount a fresh tmpfs under <filename>/dev</filename> | |
851 | (limited to 100k) and fill in a minimal set of initial devices. | |
852 | This is generally required when starting a container containing | |
853 | a "systemd" based "init" but may be optional at other times. Additional | |
854 | devices in the containers /dev directory may be created through the | |
855 | use of the <option>lxc.hook.autodev</option> hook. | |
856 | --> | |
dc421f3a KY |
857 | デフォルトでは、lxc はコンテナの <filename>/dev</filename> 以下に fd, stdin, stdout, stderr のシンボリックリンクを作成しますが、自動的にはデバイスノードのエントリは作成しません。 |
858 | これは、コンテナの rootfs で必要な設定を行えるようにするものです。 | |
859 | lxc.autodev が 1 に設定されている場合、コンテナの rootfs をマウントした後、LXC は新しい tmpfs を <filename>/dev</filename> 以下にマウントします (100k 制限の)。 | |
860 | そして初期デバイスの最小限のセットを作成します。 | |
861 | これは、"systemd" ベースの "init" 環境のコンテナを起動する時に通常必要ですが、他の環境の場合はオプショナルなものです。 | |
862 | コンテナの /dev ディレクトリ内の追加デバイスは <option>lxc.hook.autodev</option> フックを使用して作成されます。 | |
fb261f53 KY |
863 | </para> |
864 | <variablelist> | |
865 | <varlistentry> | |
866 | <term> | |
867 | <option>lxc.autodev</option> | |
868 | </term> | |
869 | <listitem> | |
870 | <para> | |
871 | <!-- | |
872 | Set this to 1 to have LXC mount and populate a minimal | |
873 | <filename>/dev</filename> when starting the container. | |
874 | --> | |
dc421f3a | 875 | コンテナの起動時に LXC が /dev をマウントして、最小限の /dev を作成しているようにするには、これを 1 に設定してください。 |
fb261f53 KY |
876 | </para> |
877 | </listitem> | |
878 | </varlistentry> | |
879 | </variablelist> | |
880 | </refsect2> | |
881 | ||
882 | <refsect2> | |
883 | <title><!-- Enable kmsg symlink -->kmsg のシンボリックリンクの有効化</title> | |
884 | <para> | |
885 | <!-- | |
886 | Enable creating /dev/kmsg as symlink to /dev/console. This defaults to 1. | |
887 | --> | |
dc421f3a | 888 | /dev/kmsg の /dev/console へのシンボリックリンクとしての作成を有効にします。デフォルトは 1 です。 |
fb261f53 KY |
889 | </para> |
890 | <variablelist> | |
891 | <varlistentry> | |
892 | <term> | |
893 | <option>lxc.kmsg</option> | |
894 | </term> | |
895 | <listitem> | |
896 | <para> | |
897 | <!-- | |
898 | Set this to 0 to disable /dev/kmsg symlinking. | |
899 | --> | |
dc421f3a | 900 | /dev/kmsg のシンボリックリンクを無効にするには 0 を設定してください。 |
fb261f53 KY |
901 | </para> |
902 | </listitem> | |
903 | </varlistentry> | |
904 | </variablelist> | |
905 | </refsect2> | |
906 | ||
907 | <refsect2> | |
908 | <title><!-- Mount points -->マウントポイント</title> | |
909 | <para> | |
910 | <!-- | |
911 | The mount points section specifies the different places to be | |
912 | mounted. These mount points will be private to the container | |
913 | and won't be visible by the processes running outside of the | |
914 | container. This is useful to mount /etc, /var or /home for | |
915 | examples. | |
916 | --> | |
dc421f3a KY |
917 | マウントポイントセクションは、マウントするための区別された場所を指定します。 |
918 | これらのマウントポイントは、コンテナだけに見え、コンテナ外で実行されるプロセスから見えることはありません。 | |
919 | 例えば、/etc や /var や /home をマウントするときに役に立つでしょう。 | |
fb261f53 KY |
920 | </para> |
921 | <variablelist> | |
922 | <varlistentry> | |
923 | <term> | |
924 | <option>lxc.mount</option> | |
925 | </term> | |
926 | <listitem> | |
927 | <para> | |
928 | <!-- | |
929 | specify a file location in | |
930 | the <filename>fstab</filename> format, containing the | |
e053b31e KY |
931 | mount information. The mount target location can and in |
932 | most cases should be a relative path, which will become | |
933 | relative to the mounted container root. For instance, | |
934 | --> | |
935 | マウント情報の書かれた <filename>fstab</filename> フォーマットで書かれたファイルの場所を指定します。 | |
936 | マウントする場所は相対バスで書くことができます。そして、ほとんどの場合にコンテナの root からの相対パスとなるはずです。例えば、以下のように書きます。 | |
937 | </para> | |
938 | <screen> | |
939 | proc proc proc nodev,noexec,nosuid 0 0 | |
940 | </screen> | |
941 | <para> | |
942 | <!-- | |
943 | Will mount a proc filesystem under the container's /proc, | |
944 | regardless of where the root filesystem comes from. This | |
945 | is resilient to block device backed filesystems as well as | |
946 | container cloning. | |
947 | --> | |
948 | この例は、root ファイルシステムがどこにあっても、コンテナの /proc 以下に proc ファイルシステムをマウントします。 | |
949 | これは、ブロックデバイスがバックエンドのファイルシステムだけでなく、コンテナのクローンにも柔軟に対応できます。 | |
950 | </para> | |
16bc569b | 951 | <para> |
e053b31e KY |
952 | <!-- |
953 | Note that when mounting a filesystem from an | |
fb261f53 KY |
954 | image file or block device the third field (fs_vfstype) |
955 | cannot be auto as with | |
956 | <citerefentry> | |
957 | <refentrytitle>mount</refentrytitle> | |
958 | <manvolnum>8</manvolnum> | |
959 | </citerefentry> | |
960 | but must be explicitly specified. | |
961 | --> | |
dc421f3a | 962 | ファイルシステムがイメージファイルやブロックデバイスからマウントされている場合、3 つ目のフィールド (fs_vfstype) は |
fb261f53 KY |
963 | <citerefentry> |
964 | <refentrytitle>mount</refentrytitle> | |
965 | <manvolnum>8</manvolnum> | |
966 | </citerefentry> | |
dc421f3a | 967 | のように auto を指定することはできず、明確に指定しなければいけません。 |
fb261f53 KY |
968 | </para> |
969 | </listitem> | |
970 | </varlistentry> | |
971 | ||
972 | <varlistentry> | |
973 | <term> | |
974 | <option>lxc.mount.entry</option> | |
975 | </term> | |
976 | <listitem> | |
977 | <para> | |
978 | <!-- | |
979 | specify a mount point corresponding to a line in the | |
980 | fstab format. | |
981 | --> | |
dc421f3a | 982 | fstab フォーマットの一行と同じフォーマットのマウントポイントの指定をします。 |
fb261f53 KY |
983 | </para> |
984 | </listitem> | |
985 | </varlistentry> | |
986 | ||
987 | <varlistentry> | |
988 | <term> | |
989 | <option>lxc.mount.auto</option> | |
990 | </term> | |
991 | <listitem> | |
992 | <para> | |
993 | <!-- | |
994 | specify which standard kernel file systems should be | |
995 | automatically mounted. This may dramatically simplify | |
996 | the configuration. The file systems are: | |
997 | --> | |
dc421f3a KY |
998 | 標準のカーネルファイルシステムで自動的にマウントするものを指定します。 |
999 | これは劇的に設定を容易にする可能性があります。 | |
fb261f53 KY |
1000 | </para> |
1001 | <itemizedlist> | |
1002 | <listitem> | |
1003 | <!-- | |
1004 | <para> | |
1005 | <option>proc:mixed</option> (or <option>proc</option>): | |
1006 | mount <filename>/proc</filename> as read-write, but | |
1007 | remount <filename>/proc/sys</filename> and | |
1008 | <filename>/proc/sysrq-trigger</filename> read-only | |
1009 | for security / container isolation purposes. | |
1010 | </para> | |
1011 | --> | |
1012 | <para> | |
1013 | <option>proc:mixed</option> (or <option>proc</option>): | |
dc421f3a KY |
1014 | <filename>/proc</filename> を読み書き可能でマウントします。 |
1015 | ただし、<filename>/proc/sys</filename> と <filename>/proc/sysrq-trigger</filename> は、セキュリティとコンテナの隔離の目的でリードオンリーで再マウントされます。 | |
fb261f53 KY |
1016 | </para> |
1017 | </listitem> | |
1018 | <listitem> | |
1019 | <!-- | |
1020 | <para> | |
1021 | <option>proc:rw</option>: mount | |
1022 | <filename>/proc</filename> as read-write | |
1023 | </para> | |
1024 | --> | |
1025 | <para> | |
1026 | <option>proc:rw</option>: | |
dc421f3a | 1027 | <filename>/proc</filename> を読み書き可能でマウントします。 |
fb261f53 KY |
1028 | </para> |
1029 | </listitem> | |
1030 | <listitem> | |
1031 | <!-- | |
1032 | <para> | |
1033 | <option>sys:ro</option> (or <option>sys</option>): | |
1034 | mount <filename>/sys</filename> as read-only | |
1035 | for security / container isolation purposes. | |
1036 | </para> | |
1037 | --> | |
1038 | <para> | |
1039 | <option>sys:ro</option> (or <option>sys</option>): | |
dc421f3a | 1040 | <filename>/sys</filename> を、セキュリティとコンテナの隔離の目的でリードオンリーでマウントします。 |
fb261f53 KY |
1041 | </para> |
1042 | </listitem> | |
1043 | <listitem> | |
1044 | <!-- | |
1045 | <para> | |
1046 | <option>sys:rw</option>: mount | |
1047 | <filename>/sys</filename> as read-write | |
1048 | </para> | |
1049 | --> | |
1050 | <para> | |
1051 | <option>sys:rw</option>: | |
dc421f3a | 1052 | <filename>/sys</filename> を読み書き可能でマウントします。 |
fb261f53 KY |
1053 | </para> |
1054 | </listitem> | |
1055 | <listitem> | |
1056 | <!-- | |
1057 | <para> | |
aafea1f7 | 1058 | <option>cgroup:mixed</option>: |
fb261f53 KY |
1059 | mount a tmpfs to <filename>/sys/fs/cgroup</filename>, |
1060 | create directories for all hierarchies to which | |
1061 | the container is added, create subdirectories | |
1062 | there with the name of the cgroup, and bind-mount | |
1063 | the container's own cgroup into that directory. | |
1064 | The container will be able to write to its own | |
1065 | cgroup directory, but not the parents, since they | |
1066 | will be remounted read-only | |
1067 | </para> | |
1068 | --> | |
1069 | <para> | |
58291e3a | 1070 | <option>cgroup:mixed</option>: |
dc421f3a KY |
1071 | <filename>/sys/fs/cgroup</filename> を tmpfs でマウントし、そのコンテナの追加が行われた全ての階層構造に対するディレクトリを作製し、その cgroup の名前でその中にサブディレクトリを作製し、そのコンテナ自身の cgroup をそのディレクトリにバインドマウントします。 |
1072 | コンテナは自身の cgroup ディレクトリに書き込みが可能ですが、親ディレクトリはリードオンリーで再マウントされているため書き込めません。 | |
fb261f53 KY |
1073 | </para> |
1074 | </listitem> | |
1075 | <listitem> | |
1076 | <!-- | |
1077 | <para> | |
1078 | <option>cgroup:ro</option>: similar to | |
1079 | <option>cgroup:mixed</option>, but everything will | |
1080 | be mounted read-only. | |
1081 | </para> | |
1082 | --> | |
1083 | <para> | |
1084 | <option>cgroup:ro</option>: | |
dc421f3a | 1085 | <option>cgroup:mixed</option> と同様にマウントされますが、全てリードオンリーでマウントされます。 |
fb261f53 KY |
1086 | </para> |
1087 | </listitem> | |
1088 | <listitem> | |
1089 | <!-- | |
1090 | <para> | |
1091 | <option>cgroup:rw</option>: similar to | |
1092 | <option>cgroup:mixed</option>, but everything will | |
1093 | be mounted read-write. Note that the paths leading | |
1094 | up to the container's own cgroup will be writable, | |
1095 | but will not be a cgroup filesystem but just part | |
1096 | of the tmpfs of <filename>/sys/fs/cgroup</filename> | |
1097 | </para> | |
1098 | --> | |
1099 | <para> | |
1100 | <option>cgroup:rw</option>: | |
dc421f3a KY |
1101 | <option>cgroup:mixed</option> と同様にマウントされますが、全て読み書き可能でマウントされます。 |
1102 | コンテナ自身の cgroup に至るまでのパスも書き込み可能になることに注意が必要ですが、cgroup ファイルシステムにはならず、 | |
1103 | <filename>/sys/fs/cgroup</filename> の tmpfs の一部分になるでしょう。 | |
fb261f53 KY |
1104 | </para> |
1105 | </listitem> | |
aafea1f7 KY |
1106 | <listitem> |
1107 | <para> | |
1108 | <!-- | |
1109 | <option>cgroup</option> (without specifier): | |
1110 | defaults to <option>cgroup:rw</option> if the | |
1111 | container retains the CAP_SYS_ADMIN capability, | |
1112 | <option>cgroup:mixed</option> otherwise. | |
1113 | --> | |
1114 | <option>cgroup</option> (マウントオプションなしの場合): | |
1115 | コンテナが CAP_SYS_ADMIN ケーパビリティを保持している場合、<option>cgroup:rw</option> となります。保持していない場合、<option>cgroup:mixed</option> となります。 | |
1116 | </para> | |
1117 | </listitem> | |
fb261f53 KY |
1118 | <listitem> |
1119 | <!-- | |
1120 | <para> | |
aafea1f7 | 1121 | <option>cgroup-full:mixed</option>: |
fb261f53 KY |
1122 | mount a tmpfs to <filename>/sys/fs/cgroup</filename>, |
1123 | create directories for all hierarchies to which | |
1124 | the container is added, bind-mount the hierarchies | |
1125 | from the host to the container and make everything | |
1126 | read-only except the container's own cgroup. Note | |
1127 | that compared to <option>cgroup</option>, where | |
1128 | all paths leading up to the container's own cgroup | |
1129 | are just simple directories in the underlying | |
1130 | tmpfs, here | |
1131 | <filename>/sys/fs/cgroup/$hierarchy</filename> | |
1132 | will contain the host's full cgroup hierarchy, | |
1133 | albeit read-only outside the container's own cgroup. | |
1134 | This may leak quite a bit of information into the | |
1135 | container. | |
1136 | </para> | |
1137 | --> | |
1138 | <para> | |
58291e3a | 1139 | <option>cgroup-full:mixed</option>: |
dc421f3a KY |
1140 | <filename>/sys/fs/cgroup</filename> を tmpfs でマウントし、そのコンテナの追加が行われた全ての階層構造に対するディレクトリを作製し、ホストからコンテナまでの階層構造を全てバインドマウントし、コンテナ自身の cgroup を除いてリードオンリーにします。 |
1141 | <option>cgroup</option> と比べると、コンテナ自身の cgroup に至るまでの全てのパスが tmpfs の下層のシンプルなディレクトリとなり、コンテナ自身の cgroup の外ではリードオンリーになりますが、<filename>/sys/fs/cgroup/$hierarchy</filename> はホストの全ての cgroup 階層構造を含みます。 | |
1142 | これにより、コンテナにはかなりの情報が漏洩します。 | |
fb261f53 KY |
1143 | </para> |
1144 | </listitem> | |
1145 | <listitem> | |
1146 | <!-- | |
1147 | <para> | |
1148 | <option>cgroup-full:ro</option>: similar to | |
1149 | <option>cgroup-full:mixed</option>, but everything | |
1150 | will be mounted read-only. | |
1151 | </para> | |
1152 | --> | |
1153 | <para> | |
1154 | <option>cgroup-full:ro</option>: | |
dc421f3a | 1155 | <option>cgroup-full:mixed</option> と同様にマウントされますが、全てリードオンリーでマウントされます。 |
fb261f53 KY |
1156 | </para> |
1157 | </listitem> | |
1158 | <listitem> | |
1159 | <!-- | |
1160 | <para> | |
1161 | <option>cgroup-full:rw</option>: similar to | |
1162 | <option>cgroup-full:mixed</option>, but everything | |
1163 | will be mounted read-write. Note that in this case, | |
1164 | the container may escape its own cgroup. (Note also | |
1165 | that if the container has CAP_SYS_ADMIN support | |
1166 | and can mount the cgroup filesystem itself, it may | |
1167 | do so anyway.) | |
1168 | </para> | |
1169 | --> | |
1170 | <para> | |
1171 | <option>cgroup-full:rw</option>: | |
dc421f3a KY |
1172 | <option>cgroup-full:mixed</option>と同様にマウントされますが、全て読み書き可能でマウントされます。 |
1173 | この場合、コンテナは自身の cgroup から脱出する可能性があることに注意してください (コンテナが CAP_SYS_ADMIN を持ち、自身で cgroup ファイルシステムをマウント可能なら、いずれにせよそのようにするかもしれないことにも注意してください)。 | |
fb261f53 KY |
1174 | </para> |
1175 | </listitem> | |
aafea1f7 KY |
1176 | <listitem> |
1177 | <para> | |
1178 | <!-- | |
1179 | <option>cgroup-full</option> (without specifier): | |
1180 | defaults to <option>cgroup-full:rw</option> if the | |
1181 | container retains the CAP_SYS_ADMIN capability, | |
1182 | <option>cgroup-full:mixed</option> otherwise. | |
1183 | --> | |
1184 | <option>cgroup-full</option> (マウントオプションなしの場合): | |
1185 | コンテナが CAP_SYS_ADMIN ケーパビリティを保持している場合、<option>cgroup-full:rw</option> となります。保持していない場合、<option>cgroup-full:mixed</option> となります。 | |
1186 | </para> | |
1187 | </listitem> | |
fb261f53 | 1188 | </itemizedlist> |
cf5f3128 KY |
1189 | <para> |
1190 | <!-- | |
1191 | Note that if automatic mounting of the cgroup filesystem | |
1192 | is enabled, the tmpfs under | |
1193 | <filename>/sys/fs/cgroup</filename> will always be | |
1194 | mounted read-write (but for the <option>:mixed</option> | |
1195 | and <option>:ro</option> cases, the individual | |
1196 | hierarchies, | |
1197 | <filename>/sys/fs/cgroup/$hierarchy</filename>, will be | |
1198 | read-only). This is in order to work around a quirk in | |
1199 | Ubuntu's | |
1200 | <citerefentry> | |
1201 | <refentrytitle>mountall</refentrytitle> | |
1202 | <manvolnum>8</manvolnum> | |
1203 | </citerefentry> | |
1204 | command that will cause containers to wait for user | |
1205 | input at boot if | |
1206 | <filename>/sys/fs/cgroup</filename> is mounted read-only | |
1207 | and the container can't remount it read-write due to a | |
1208 | lack of CAP_SYS_ADMIN. | |
1209 | --> | |
1210 | cgroup ファイルシステムの自動マウントが有効の場合、<filename>/sys/fs/cgroup</filename> 以下の tmpfs は常に読み書き可能でマウントされることに注意が必要です (しかし <option>:mixed</option> と <option>:ro</option> の場合は、個々の階層の <filename>/sys/fs/cgroup/$hierarchy</filename> は読み込み専用となるでしょう)。これは Ubuntu の | |
1211 | <citerefentry> | |
1212 | <refentrytitle>mountall</refentrytitle> | |
1213 | <manvolnum>8</manvolnum> | |
1214 | </citerefentry> | |
1215 | コマンドの特異な動きに対処するためのものです。特異な動きとは、<filename>/sys/fs/cgroup</filename> が読み込み専用でマウントされた状態で、コンテナが CAP_SYS_ADMIN を持たない場合、/sys/fs/cgroup を読み書き可能で再マウントしようとしてできないため、コンテナのブート時にユーザからの入力を待ってしまうというものです。 | |
1216 | </para> | |
fb261f53 KY |
1217 | <para> |
1218 | <!-- | |
1219 | Examples: | |
1220 | --> | |
1221 | 例: | |
1222 | </para> | |
1223 | <programlisting> | |
1224 | lxc.mount.auto = proc sys cgroup | |
1225 | lxc.mount.auto = proc:rw sys:rw cgroup-full:rw | |
1226 | </programlisting> | |
1227 | </listitem> | |
1228 | </varlistentry> | |
1229 | ||
1230 | </variablelist> | |
1231 | </refsect2> | |
1232 | ||
1233 | <refsect2> | |
1234 | <title><!-- Root file system -->ルートファイルシステム</title> | |
1235 | <para> | |
1236 | <!-- | |
1237 | The root file system of the container can be different than that | |
1238 | of the host system. | |
1239 | --> | |
dc421f3a | 1240 | コンテナのルートファイルシステムは、ホストのルートファイルシステムと異なるようにすることも可能です。 |
fb261f53 KY |
1241 | </para> |
1242 | <variablelist> | |
1243 | <varlistentry> | |
1244 | <term> | |
1245 | <option>lxc.rootfs</option> | |
1246 | </term> | |
1247 | <listitem> | |
1248 | <para> | |
1249 | <!-- | |
1250 | specify the root file system for the container. It can | |
1251 | be an image file, a directory or a block device. If not | |
1252 | specified, the container shares its root file system | |
1253 | with the host. | |
1254 | --> | |
dc421f3a KY |
1255 | コンテナのルートファイルシステムになるディレクトリを指定します。 |
1256 | この値はイメージファイル、ディレクトリ、ブロックデバイスのどれかを取ることができます。 | |
1257 | もし指定されない場合、コンテナはホストとルートファイルシステムを共有します。 | |
fb261f53 | 1258 | </para> |
a4dbc45f KY |
1259 | <para> |
1260 | <!-- | |
1261 | For directory or simple block-device backed containers, | |
1262 | a pathname can be used. If the rootfs is backed by a nbd | |
1263 | device, then <filename>nbd:file:1</filename> specifies that | |
1264 | <filename>file</filename> should be attached to a nbd device, | |
1265 | and partition 1 should be mounted as the rootfs. | |
1266 | <filename>nbd:file</filename> specifies that the nbd device | |
1267 | itself should be mounted. <filename>overlayfs:/lower:/upper</filename> | |
1268 | specifies that the rootfs should be an overlay with <filename>/upper</filename> | |
1269 | being mounted read-write over a read-only mount of <filename>/lower</filename>. | |
1270 | <filename>aufs:/lower:/upper</filename> does the same using aufs in place | |
1271 | of overlayfs. <filename>loop:/file</filename> tells lxc to attach | |
1272 | <filename>/file</filename> to a loop device and mount the loop device. | |
1273 | --> | |
1274 | ディレクトリ、単純なブロックデバイスのバックエンドを持つコンテナの場合、パス名を使うことができます。 | |
1275 | もし rootfs が nbd デバイスの場合、<filename>nbd:file:1</filename> という指定は <filename>file</filename> を nbd デバイスとして使用し、その 1 番目のパーティションが rootfs としてマウントされます。 | |
1276 | <filename>nbd:file</filename> という指定は、nbd デバイス自身をマウントします。 | |
1277 | <filename>overlayfs:/lower:/upper</filename> という指定は、rootfs は <filename>/lower</filename> という読み込み専用でマウントされるディレクトリの上に、<filename>/upper</filename> というディレクトリを読み書き可能で重ね合わせてマウントします。 | |
1278 | <filename>aufs:/lower:/upper</filename> は overlayfs で指定している部分を aufs と指定すれば同じことになります。 | |
1279 | <filename>loop:/file</filename> は <filename>/file</filename> を loop デバイスとして使用し、loop デバイスをマウントします。 | |
1280 | </para> | |
fb261f53 KY |
1281 | </listitem> |
1282 | </varlistentry> | |
1283 | ||
1284 | <varlistentry> | |
1285 | <term> | |
1286 | <option>lxc.rootfs.mount</option> | |
1287 | </term> | |
1288 | <listitem> | |
1289 | <para> | |
1290 | <!-- | |
1291 | where to recursively bind <option>lxc.rootfs</option> | |
1292 | before pivoting. This is to ensure success of the | |
1293 | <citerefentry> | |
1294 | <refentrytitle><command>pivot_root</command></refentrytitle> | |
1295 | <manvolnum>8</manvolnum> | |
1296 | </citerefentry> | |
1297 | syscall. Any directory suffices, the default should | |
1298 | generally work. | |
1299 | --> | |
dc421f3a | 1300 | root ファイルシステムの変更の前に、<option>lxc.rootfs</option> を再帰的にどこにバインドするのかを指定します。これは |
fb261f53 KY |
1301 | <citerefentry> |
1302 | <refentrytitle><command>pivot_root</command></refentrytitle> | |
1303 | <manvolnum>8</manvolnum> | |
1304 | </citerefentry> | |
dc421f3a KY |
1305 | システムコールが確実に成功する事を保証します。 |
1306 | どんなディレクトリでも良く、デフォルトでも通常は動くはずです。 | |
fb261f53 KY |
1307 | </para> |
1308 | </listitem> | |
1309 | </varlistentry> | |
1310 | ||
b4c66de1 KY |
1311 | <varlistentry> |
1312 | <term> | |
1313 | <option>lxc.rootfs.options</option> | |
1314 | </term> | |
1315 | <listitem> | |
1316 | <para> | |
1317 | <!-- | |
1318 | extra mount options to use when mounting the rootfs. | |
1319 | --> | |
dc421f3a | 1320 | rootfs をマウントするときに追加したいマウントオプション。 |
b4c66de1 KY |
1321 | </para> |
1322 | </listitem> | |
1323 | </varlistentry> | |
1324 | ||
fb261f53 KY |
1325 | <varlistentry> |
1326 | <term> | |
1327 | <option>lxc.pivotdir</option> | |
1328 | </term> | |
1329 | <listitem> | |
1330 | <para> | |
1331 | <!-- | |
1332 | where to pivot the original root file system under | |
1333 | <option>lxc.rootfs</option>, specified relatively to | |
1334 | that. The default is <filename>mnt</filename>. | |
1335 | It is created if necessary, and also removed after | |
1336 | unmounting everything from it during container setup. | |
1337 | --> | |
dc421f3a KY |
1338 | 元の root ファイルシステムを、<option>lxc.rootfs</option> 以下のどこに移動させるかを <option>lxc.rootfs</option> からの相対パスで指定します。 |
1339 | デフォルトは <filename>mnt</filename> です。 | |
1340 | これはもし必要であれば作成され、そしてコンテナのセットアップの間、全てアンマウントされた後で消去されます。 | |
fb261f53 KY |
1341 | </para> |
1342 | </listitem> | |
1343 | </varlistentry> | |
1344 | </variablelist> | |
1345 | </refsect2> | |
1346 | ||
1347 | <refsect2> | |
1348 | <title>Control group</title> | |
1349 | <para> | |
1350 | <!-- | |
1351 | The control group section contains the configuration for the | |
1352 | different subsystem. <command>lxc</command> does not check the | |
1353 | correctness of the subsystem name. This has the disadvantage | |
1354 | of not detecting configuration errors until the container is | |
1355 | started, but has the advantage of permitting any future | |
1356 | subsystem. | |
1357 | --> | |
dc421f3a KY |
1358 | CONTROL GROUP セクションは、(lxc とは) 別のサブシステムの設定を含みます。 |
1359 | <command>lxc</command> は、このサブシステム名の正しさはチェックしません。 | |
1360 | 実行時のエラーを検出するのに不便ですが、別の将来のサブシステムをサポート出来るという有利な点もあります。 | |
fb261f53 KY |
1361 | </para> |
1362 | <variablelist> | |
1363 | <varlistentry> | |
1364 | <term> | |
1365 | <option>lxc.cgroup.[subsystem name]</option> | |
1366 | </term> | |
1367 | <listitem> | |
1368 | <para> | |
1369 | <!-- | |
1370 | specify the control group value to be set. The | |
1371 | subsystem name is the literal name of the control group | |
1372 | subsystem. The permitted names and the syntax of their | |
1373 | values is not dictated by LXC, instead it depends on the | |
1374 | features of the Linux kernel running at the time the | |
1375 | container is started, | |
1376 | eg. <option>lxc.cgroup.cpuset.cpus</option> | |
1377 | --> | |
dc421f3a KY |
1378 | 設定する control group の値を指定します。 |
1379 | サブシステム名は、control group のそのままの名前です。 | |
1380 | 許される名前や値の書式は LXC が指示することはなく、コンテナが実行された時に実行されている Linux カーネルの機能に依存します。 | |
fb261f53 KY |
1381 | 例えば <option>lxc.cgroup.cpuset.cpus</option> |
1382 | </para> | |
1383 | </listitem> | |
1384 | </varlistentry> | |
1385 | </variablelist> | |
1386 | </refsect2> | |
1387 | ||
1388 | <refsect2> | |
1389 | <title><!-- Capabilities -->ケーパビリティ</title> | |
1390 | <para> | |
1391 | <!-- | |
1392 | The capabilities can be dropped in the container if this one | |
1393 | is run as root. | |
1394 | --> | |
dc421f3a | 1395 | コンテナが root 権限で実行されていても、コンテナ内ではケーパビリティ (capabilities) を削除する事は可能です。 |
fb261f53 KY |
1396 | </para> |
1397 | <variablelist> | |
1398 | <varlistentry> | |
1399 | <term> | |
1400 | <option>lxc.cap.drop</option> | |
1401 | </term> | |
1402 | <listitem> | |
1403 | <para> | |
1404 | <!-- | |
1405 | Specify the capability to be dropped in the container. A | |
1406 | single line defining several capabilities with a space | |
1407 | separation is allowed. The format is the lower case of | |
1408 | the capability definition without the "CAP_" prefix, | |
1409 | eg. CAP_SYS_MODULE should be specified as | |
1410 | sys_module. See | |
1411 | <citerefentry> | |
1412 | <refentrytitle><command>capabilities</command></refentrytitle> | |
1413 | <manvolnum>7</manvolnum> | |
1414 | </citerefentry>, | |
1415 | --> | |
dc421f3a KY |
1416 | コンテナ内で削除するケーパビリティ (capability) を指定します。 |
1417 | 一行でスペース区切りで複数のケーパビリティを指定することも可能です。 | |
1418 | 指定は、"CAP_" というプレフィックスなしで、小文字でケーパビリティを指定します。 | |
1419 | 例えば、CAP_SYS_MODULE というケーパビリティは sys_module と指定する必要があります。 | |
1420 | 詳しくは以下を参照してください。 | |
fb261f53 KY |
1421 | <citerefentry> |
1422 | <refentrytitle><command>capabilities</command></refentrytitle> | |
1423 | <manvolnum>7</manvolnum> | |
1424 | </citerefentry> | |
1425 | </para> | |
1426 | </listitem> | |
1427 | </varlistentry> | |
1428 | <varlistentry> | |
1429 | <term> | |
1430 | <option>lxc.cap.keep</option> | |
1431 | </term> | |
1432 | <listitem> | |
1433 | <para> | |
1434 | <!-- | |
1435 | Specify the capability to be kept in the container. All other | |
f36062dc KY |
1436 | capabilities will be dropped. When a special value of "none" is |
1437 | encountered, lxc will clear any keep capabilities specified up | |
1438 | to this point. A value of "none" alone can be used to drop all | |
1439 | capabilities. | |
fb261f53 | 1440 | --> |
f36062dc KY |
1441 | コンテナ内で維持するケーパビリティを指定します。指定した以外の全てのケーパビリティはドロップされます。 |
1442 | 特別な値 "none" が指定されている時点で、lxc はこの時点で保持することになっている全てのケーパビリティをクリアします。"none" を単独で使用するとすべてのケーパビリティを削除できます。 | |
fb261f53 KY |
1443 | </para> |
1444 | </listitem> | |
1445 | </varlistentry> | |
1446 | </variablelist> | |
1447 | </refsect2> | |
1448 | ||
1449 | <refsect2> | |
1450 | <title><!-- Apparmor profile -->Apparmor プロファイル</title> | |
1451 | <para> | |
1452 | <!-- | |
1453 | If lxc was compiled and installed with apparmor support, and the host | |
1454 | system has apparmor enabled, then the apparmor profile under which the | |
1455 | container should be run can be specified in the container | |
1456 | configuration. The default is <command>lxc-container-default</command>. | |
1457 | --> | |
dc421f3a KY |
1458 | lxc が apparmor サポートでコンパイルされ、インストールされている場合で、ホストで apparmor が有効な場合、コンテナが従って動くべき apparmor プロファイルは、コンテナの設定で指定することが可能です。 |
1459 | デフォルトは <command>lxc-container-default</command> です。 | |
fb261f53 KY |
1460 | </para> |
1461 | <variablelist> | |
1462 | <varlistentry> | |
1463 | <term> | |
1464 | <option>lxc.aa_profile</option> | |
1465 | </term> | |
1466 | <listitem> | |
1467 | <para> | |
1468 | <!-- | |
1469 | Specify the apparmor profile under which the container should | |
1470 | be run. To specify that the container should be unconfined, | |
1471 | use | |
1472 | --> | |
dc421f3a KY |
1473 | コンテナが従うべき apparmor プロファイルを指定します。 |
1474 | コンテナが apparmor による制限を受けないように設定するには、以下のように設定します。 | |
fb261f53 KY |
1475 | </para> |
1476 | <programlisting>lxc.aa_profile = unconfined</programlisting> | |
1477 | </listitem> | |
1478 | </varlistentry> | |
1479 | </variablelist> | |
1480 | </refsect2> | |
1481 | ||
1482 | <refsect2> | |
1483 | <title><!-- SELinux context -->SELinux コンテキスト</title> | |
1484 | <para> | |
1485 | <!-- | |
1486 | If lxc was compiled and installed with SELinux support, and the host | |
1487 | system has SELinux enabled, then the SELinux context under which the | |
1488 | container should be run can be specified in the container | |
1489 | configuration. The default is <command>unconfined_t</command>, | |
1490 | which means that lxc will not attempt to change contexts. | |
1491 | --> | |
dc421f3a KY |
1492 | lxc が SELinux サポートでコンパイルされ、インストールされている場合で、ホストで SELinux が有効な場合、コンテナが従って動くべき SELinux コンテキストは、コンテナの設定で指定することが可能です。 |
1493 | デフォルトは <command>unconfined_t</command> であり、これは lxc がコンテキストを変えないという意味になります。 | |
fb261f53 KY |
1494 | </para> |
1495 | <variablelist> | |
1496 | <varlistentry> | |
1497 | <term> | |
1498 | <option>lxc.se_context</option> | |
1499 | </term> | |
1500 | <listitem> | |
1501 | <para> | |
1502 | <!-- | |
1503 | Specify the SELinux context under which the container should | |
1504 | be run or <command>unconfined_t</command>. For example | |
1505 | --> | |
dc421f3a | 1506 | コンテナが従うべき SELinux コンテキストを指定するか、<command>unconfined_t</command> を指定します。例えば以下のように設定します。 |
fb261f53 KY |
1507 | </para> |
1508 | <programlisting>lxc.se_context = unconfined_u:unconfined_r:lxc_t:s0-s0:c0.c1023</programlisting> | |
1509 | </listitem> | |
1510 | </varlistentry> | |
1511 | </variablelist> | |
1512 | </refsect2> | |
1513 | ||
1514 | <refsect2> | |
1515 | <title><!-- Seccomp configuration -->Seccomp の設定</title> | |
1516 | <para> | |
1517 | <!-- | |
1518 | A container can be started with a reduced set of available | |
1519 | system calls by loading a seccomp profile at startup. The | |
4473e38b KY |
1520 | seccomp configuration file must begin with a version number |
1521 | on the first line, a policy type on the second line, followed | |
1522 | by the configuration. | |
fb261f53 | 1523 | --> |
dc421f3a KY |
1524 | コンテナは、起動時に seccomp プロファイルをロードすることで、利用可能なシステムコールを減らして起動することが可能です。 |
1525 | seccomp の設定ファイルは、1 行目がバージョン番号、2 行目がポリシーのタイプで始まる必要があり、その後に設定を書きます。 | |
fb261f53 | 1526 | </para> |
4473e38b KY |
1527 | <para> |
1528 | <!-- | |
1529 | Versions 1 and 2 are currently supported. In version 1, the | |
1530 | policy is a simple whitelist. The second line therefore must | |
1531 | read "whitelist", with the rest of the file containing one (numeric) | |
1532 | sycall number per line. Each syscall number is whitelisted, | |
1533 | while every unlisted number is blacklisted for use in the container | |
1534 | --> | |
dc421f3a KY |
1535 | 現時点では、バージョン番号は 1 と 2 をサポートしています。バージョン 1 では、ポリシーはシンプルなホワイトリストですので、2 行目は "whitelist" でなければなりません。 |
1536 | そして残りの行には 1 行に 1 つずつ、システムコール番号を書きます。各行のシステムコール番号がホワイトリスト化され、リストにない番号は、そのコンテナではブラックリストに入ります。 | |
4473e38b KY |
1537 | </para> |
1538 | ||
1539 | <para> | |
1540 | <!-- | |
1541 | In version 2, the policy may be blacklist or whitelist, | |
1542 | supports per-rule and per-policy default actions, and supports | |
1543 | per-architecture system call resolution from textual names. | |
1544 | --> | |
dc421f3a | 1545 | バージョン 2 では、ポリシーはブラックリストもしくはホワイトリストで表され、ルールごとのアクションと、ポリシーごとのデフォルトのアクションを設定できます。そして、アーキテクチャごとの設定と、テキストで書かれたシステムコール名での設定が可能です。 |
4473e38b KY |
1546 | </para> |
1547 | <para> | |
1548 | <!-- | |
1549 | An example blacklist policy, in which all system calls are | |
1550 | allowed except for mknod, which will simply do nothing and | |
1551 | return 0 (success), looks like: | |
1552 | --> | |
dc421f3a | 1553 | 以下にブラックリストのポリシーの例を示します。これは mknod 以外の全てのシステムコールが許可され、mknod が呼ばれると、何もせずに単に 0(成功) を返します。 |
4473e38b KY |
1554 | </para> |
1555 | <screen> | |
1556 | 2 | |
1557 | blacklist | |
1558 | mknod errno 0 | |
1559 | </screen> | |
fb261f53 KY |
1560 | <variablelist> |
1561 | <varlistentry> | |
1562 | <term> | |
1563 | <option>lxc.seccomp</option> | |
1564 | </term> | |
1565 | <listitem> | |
1566 | <para> | |
1567 | <!-- | |
1568 | Specify a file containing the seccomp configuration to | |
1569 | load before the container starts. | |
1570 | --> | |
dc421f3a | 1571 | コンテナがスタートする前にロードする seccomp の設定を含むファイルを指定します。 |
fb261f53 KY |
1572 | </para> |
1573 | </listitem> | |
1574 | </varlistentry> | |
1575 | </variablelist> | |
1576 | </refsect2> | |
1577 | ||
1578 | <refsect2> | |
1579 | <title><!-- UID mappings -->UID のマッピング</title> | |
1580 | <para> | |
1581 | <!-- | |
1582 | A container can be started in a private user namespace with | |
1583 | user and group id mappings. For instance, you can map userid | |
1584 | 0 in the container to userid 200000 on the host. The root | |
1585 | user in the container will be privileged in the container, | |
1586 | but unprivileged on the host. Normally a system container | |
1587 | will want a range of ids, so you would map, for instance, | |
1588 | user and group ids 0 through 20,000 in the container to the | |
1589 | ids 200,000 through 220,000. | |
1590 | --> | |
dc421f3a KY |
1591 | コンテナは、ユーザとグループの id のマッピングを持った専用のユーザ名前空間で起動することが可能です。 |
1592 | たとえば、コンテナ内のユーザ id 0 を、ホストのユーザ id 200000 にマッピングすることが可能です。 | |
1593 | コンテナの root ユーザはコンテナ内では特権を持ちますが、ホストでは特権を持ちません。 | |
1594 | 通常は、システムコンテナは id の範囲を要求し、それをマッピングします。 | |
1595 | 例えば、コンテナ内のユーザとグループの id 0 から 20,000 を 200,000 から 220,000 にマッピングします。 | |
fb261f53 KY |
1596 | </para> |
1597 | <variablelist> | |
1598 | <varlistentry> | |
1599 | <term> | |
1600 | <option>lxc.id_map</option> | |
1601 | </term> | |
1602 | <listitem> | |
1603 | <para> | |
1604 | <!-- | |
1605 | Four values must be provided. First a character, either | |
1606 | 'u', or 'g', to specify whether user or group ids are | |
1607 | being mapped. Next is the first userid as seen in the | |
1608 | user namespace of the container. Next is the userid as | |
1609 | seen on the host. Finally, a range indicating the number | |
1610 | of consecutive ids to map. | |
1611 | --> | |
dc421f3a KY |
1612 | 4 つの値を記述する必要があります。 |
1613 | 最初の文字は 'u' か 'g' のどちらかで、ユーザかグループの ID のどちらをマッピングするかを指定します。 | |
1614 | 次はコンテナのユーザ名前空間内に現れる最初のユーザ ID です。 | |
1615 | その次は、そのユーザ ID のホスト上での値です。 | |
1616 | 最後は、ID のマッピングをいくつ連続して行うかの数を指定します。 | |
fb261f53 KY |
1617 | </para> |
1618 | </listitem> | |
1619 | </varlistentry> | |
1620 | </variablelist> | |
1621 | </refsect2> | |
1622 | ||
1623 | <refsect2> | |
1624 | <title><!-- Container hooks -->コンテナのフック</title> | |
1625 | <para> | |
1626 | <!-- | |
1627 | Container hooks are programs or scripts which can be executed | |
1628 | at various times in a container's lifetime. | |
1629 | --> | |
dc421f3a | 1630 | コンテナのフックは、コンテナの存続期間の色々な場面で実行することのできるプログラムやスクリプトです。 |
fb261f53 KY |
1631 | </para> |
1632 | <para> | |
1633 | <!-- | |
1634 | When a container hook is executed, information is passed both | |
1635 | as command line arguments and through environment variables. | |
1636 | The arguments are: | |
1637 | <itemizedlist> | |
1638 | <listitem><para> Container name. </para></listitem> | |
1639 | <listitem><para> Section (always 'lxc'). </para></listitem> | |
1640 | <listitem><para> The hook type (i.e. 'clone' or 'pre-mount'). </para></listitem> | |
1641 | <listitem><para> Additional arguments In the | |
1642 | case of the clone hook, any extra arguments passed to | |
1643 | lxc-clone will appear as further arguments to the hook. </para></listitem> | |
1644 | </itemizedlist> | |
1645 | The following environment variables are set: | |
1646 | <itemizedlist> | |
1647 | <listitem><para> LXC_NAME: is the container's name. </para></listitem> | |
1648 | <listitem><para> LXC_ROOTFS_MOUNT: the path to the mounted root filesystem. </para></listitem> | |
1649 | <listitem><para> LXC_CONFIG_FILE: the path to the container configuration file. </para></listitem> | |
1650 | <listitem><para> LXC_SRC_NAME: in the case of the clone hook, this is the original container's name. </para></listitem> | |
1651 | <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> | |
1652 | </itemizedlist> | |
1653 | --> | |
dc421f3a | 1654 | コンテナのフックが実行されるとき、情報がコマンドライン引数と環境変数の両方を通して渡されます。引数は: |
fb261f53 KY |
1655 | <itemizedlist> |
1656 | <listitem><para>コンテナ名</para></listitem> | |
1657 | <listitem><para>セクション (常に 'lxc')</para></listitem> | |
1658 | <listitem><para>フックのタイプ ('clone' や 'pre-mount' など)</para></listitem> | |
dc421f3a | 1659 | <listitem><para>追加の引数。clone フックの場合、lxc-clone に渡される追加の引数は、フックへの引数として追加されます。</para></listitem> |
fb261f53 | 1660 | </itemizedlist> |
dc421f3a | 1661 | 以下の環境変数がセットされます。 |
fb261f53 KY |
1662 | <itemizedlist> |
1663 | <listitem><para> LXC_NAME: コンテナ名</para></listitem> | |
1664 | <listitem><para> LXC_ROOTFS_MOUNT: マウントされた root ファイルシステムへのパス</para></listitem> | |
1665 | <listitem><para> LXC_CONFIG_FILE: コンテナの設定ファイルのパス </para></listitem> | |
dc421f3a KY |
1666 | <listitem><para> LXC_SRC_NAME: clone フックの場合、元のコンテナの名前</para></listitem> |
1667 | <listitem><para> LXC_ROOTFS_PATH: コンテナの lxc.rootfs エントリ。これはマウントされた rootfs が存在する場所にはならないでしょう。それには LXC_ROOTFS_MOUNT を使用してください。</para></listitem> | |
fb261f53 KY |
1668 | </itemizedlist> |
1669 | </para> | |
1670 | <para> | |
1671 | <!-- | |
1672 | Standard output from the hooks is logged at debug level. | |
1673 | Standard error is not logged, but can be captured by the | |
1674 | hook redirecting its standard error to standard output. | |
1675 | --> | |
dc421f3a KY |
1676 | スクリプトからの標準出力は debug レベルでロギングされます。 |
1677 | 標準エラー出力はロギングされません。 | |
1678 | しかし、フックの標準エラー出力を標準出力にリダイレクトすることにより保存することは可能です。 | |
fb261f53 KY |
1679 | </para> |
1680 | <variablelist> | |
1681 | <varlistentry> | |
1682 | <term> | |
1683 | <option>lxc.hook.pre-start</option> | |
1684 | </term> | |
1685 | <listitem> | |
1686 | <para> | |
1687 | <!-- | |
1688 | A hook to be run in the host's namespace before the | |
1689 | container ttys, consoles, or mounts are up. | |
1690 | --> | |
dc421f3a | 1691 | コンテナの tty、コンソールの作成、マウントが実行される前に、ホストの名前空間内で実行するフック。 |
fb261f53 KY |
1692 | </para> |
1693 | </listitem> | |
1694 | </varlistentry> | |
1695 | </variablelist> | |
1696 | <variablelist> | |
1697 | <varlistentry> | |
1698 | <term> | |
1699 | <option>lxc.hook.pre-mount</option> | |
1700 | </term> | |
1701 | <listitem> | |
1702 | <para> | |
1703 | <!-- | |
1704 | A hook to be run in the container's fs namespace but before | |
1705 | the rootfs has been set up. This allows for manipulation | |
1706 | of the rootfs, i.e. to mount an encrypted filesystem. Mounts | |
1707 | done in this hook will not be reflected on the host (apart from | |
1708 | mounts propagation), so they will be automatically cleaned up | |
1709 | when the container shuts down. | |
1710 | --> | |
dc421f3a KY |
1711 | コンテナのファイルシステムの名前空間で実行されますが、rootfs が設定される前に実行するフック。 |
1712 | これにより rootfs の操作が可能になります。 | |
1713 | 例えば、暗号化されたファイルシステムのマウントなどです。 | |
1714 | このフック内でなされるマウントはホストには影響しません (mounts propagation を除いて)。 | |
1715 | なので、それらはコンテナがシャットダウンする時に自動的にクリーンアップされます。 | |
fb261f53 KY |
1716 | </para> |
1717 | </listitem> | |
1718 | </varlistentry> | |
1719 | </variablelist> | |
1720 | <variablelist> | |
1721 | <varlistentry> | |
1722 | <term> | |
1723 | <option>lxc.hook.mount</option> | |
1724 | </term> | |
1725 | <listitem> | |
1726 | <para> | |
1727 | <!-- | |
1728 | A hook to be run in the container's namespace after | |
1729 | mounting has been done, but before the pivot_root. | |
1730 | --> | |
dc421f3a | 1731 | マウントが完了した後ですが、pivot_root の前にコンテナの名前空間で実行されるフック。 |
fb261f53 KY |
1732 | </para> |
1733 | </listitem> | |
1734 | </varlistentry> | |
1735 | </variablelist> | |
1736 | <variablelist> | |
1737 | <varlistentry> | |
1738 | <term> | |
1739 | <option>lxc.hook.autodev</option> | |
1740 | </term> | |
1741 | <listitem> | |
1742 | <para> | |
1743 | <!-- | |
1744 | A hook to be run in the container's namespace after | |
1745 | mounting has been done and after any mount hooks have | |
1746 | run, but before the pivot_root, if | |
1747 | <option>lxc.autodev</option> == 1. | |
1748 | The purpose of this hook is to assist in populating the | |
1749 | /dev directory of the container when using the autodev | |
1750 | option for systemd based containers. The container's /dev | |
1751 | directory is relative to the | |
1752 | ${<option>LXC_ROOTFS_MOUNT</option>} environment | |
1753 | variable available when the hook is run. | |
1754 | --> | |
dc421f3a KY |
1755 | <option>lxc.autodev</option> == 1 が設定されている場合で、マウントが完了し、マウント時のフックも実行された後ですが、pivot_root の前にコンテナの名前空間で実行するフック。 |
1756 | このフックの目的は、systemd ベースのコンテナ向けの autodev オプションが設定されている時に、コンテナの /dev ディレクトリを設定するのを支援することです。コンテナの /dev ディレクトリは、このフックが実行される時有効な ${<option>LXC_ROOTFS_MOUNT</option>} 環境変数からの相対パスとなります。 | |
fb261f53 KY |
1757 | </para> |
1758 | </listitem> | |
1759 | </varlistentry> | |
1760 | </variablelist> | |
1761 | <variablelist> | |
1762 | <varlistentry> | |
1763 | <term> | |
1764 | <option>lxc.hook.start</option> | |
1765 | </term> | |
1766 | <listitem> | |
1767 | <para> | |
1768 | <!-- | |
1769 | A hook to be run in the container's namespace immediately | |
1770 | before executing the container's init. This requires the | |
1771 | program to be available in the container. | |
1772 | --> | |
dc421f3a KY |
1773 | コンテナの init が実行される直前にコンテナの名前空間で実行されるフック。 |
1774 | コンテナ内で利用可能なプログラムである必要があります。 | |
fb261f53 KY |
1775 | </para> |
1776 | </listitem> | |
1777 | </varlistentry> | |
1778 | </variablelist> | |
1779 | <variablelist> | |
1780 | <varlistentry> | |
1781 | <term> | |
1782 | <option>lxc.hook.post-stop</option> | |
1783 | </term> | |
1784 | <listitem> | |
1785 | <para> | |
1786 | <!-- | |
1787 | A hook to be run in the host's namespace after the | |
1788 | container has been shut down. | |
1789 | --> | |
dc421f3a | 1790 | コンテナがシャットダウンされた後にホストの名前空間で実行するフック。 |
fb261f53 KY |
1791 | </para> |
1792 | </listitem> | |
1793 | </varlistentry> | |
1794 | </variablelist> | |
1795 | <variablelist> | |
1796 | <varlistentry> | |
1797 | <term> | |
1798 | <option>lxc.hook.clone</option> | |
1799 | </term> | |
1800 | <listitem> | |
1801 | <para> | |
1802 | <!-- | |
1803 | A hook to be run when the container is cloned to a new one. | |
1804 | See <citerefentry><refentrytitle><command>lxc-clone</command></refentrytitle> | |
1805 | <manvolnum>1</manvolnum></citerefentry> for more information. | |
1806 | --> | |
dc421f3a | 1807 | コンテナが新しいコンテナにクローンされる際に実行されるフック。詳しくは |
fb261f53 KY |
1808 | <citerefentry><refentrytitle><command>lxc-clone</command></refentrytitle> |
1809 | <manvolnum>1</manvolnum></citerefentry> | |
dc421f3a | 1810 | を参照してください。 |
fb261f53 KY |
1811 | </para> |
1812 | </listitem> | |
1813 | </varlistentry> | |
1814 | </variablelist> | |
1815 | </refsect2> | |
1816 | ||
1817 | <refsect2> | |
1818 | <title><!-- Container hooks Environment Variables -->コンテナのフックで使える環境変数</title> | |
1819 | <para> | |
1820 | <!-- | |
1821 | A number of environment variables are made available to the startup | |
1822 | hooks to provide configuration information and assist in the | |
1823 | functioning of the hooks. Not all variables are valid in all | |
1824 | contexts. In particular, all paths are relative to the host system | |
1825 | and, as such, not valid during the <option>lxc.hook.start</option> hook. | |
1826 | --> | |
dc421f3a KY |
1827 | 起動時のフックに設定情報を提供し、フックの機能を助けるための環境変数がいくつか利用可能です。 |
1828 | 全ての変数が全てのコンテキストで利用可能なわけではありません。 | |
1829 | 具体的には、全てのパスはホストシステム上のパスであり、そのため、<option>lxc.hook.start</option> フックの時点では使用できません。 | |
fb261f53 KY |
1830 | </para> |
1831 | <variablelist> | |
1832 | <varlistentry> | |
1833 | <term> | |
1834 | <option>LXC_NAME</option> | |
1835 | </term> | |
1836 | <listitem> | |
1837 | <para> | |
1838 | <!-- | |
1839 | The LXC name of the container. Useful for logging messages | |
1840 | in common log environments. [<option>-n</option>] | |
1841 | --> | |
dc421f3a | 1842 | LXC コンテナの名前。共通のログ環境内でのログメッセージに使うときに便利です。[<option>-n</option>] |
fb261f53 KY |
1843 | </para> |
1844 | </listitem> | |
1845 | </varlistentry> | |
1846 | </variablelist> | |
1847 | <variablelist> | |
1848 | <varlistentry> | |
1849 | <term> | |
1850 | <option>LXC_CONFIG_FILE</option> | |
1851 | </term> | |
1852 | <listitem> | |
1853 | <para> | |
1854 | <!-- | |
1855 | Host relative path to the container configuration file. This | |
1856 | gives the container to reference the original, top level, | |
1857 | configuration file for the container in order to locate any | |
1858 | additional configuration information not otherwise made | |
1859 | available. [<option>-f</option>] | |
1860 | --> | |
dc421f3a KY |
1861 | コンテナの設定ファイルのホスト上でのパス。 |
1862 | これは、他の方法では得られない追加の設定情報を見つけるために、コンテナに、元の、トップレベルの設定ファイルの位置を与えるものです。 [<option>-f</option>] | |
fb261f53 KY |
1863 | </para> |
1864 | </listitem> | |
1865 | </varlistentry> | |
1866 | </variablelist> | |
1867 | <variablelist> | |
1868 | <varlistentry> | |
1869 | <term> | |
1870 | <option>LXC_CONSOLE</option> | |
1871 | </term> | |
1872 | <listitem> | |
1873 | <para> | |
1874 | <!-- | |
1875 | The path to the console output of the container if not NULL. | |
1876 | [<option>-c</option>] [<option>lxc.console</option>] | |
1877 | --> | |
dc421f3a | 1878 | 設定されている場合のコンテナのコンソール出力のパス。 |
fb261f53 KY |
1879 | [<option>-c</option>] [<option>lxc.console</option>] |
1880 | </para> | |
1881 | </listitem> | |
1882 | </varlistentry> | |
1883 | </variablelist> | |
1884 | <variablelist> | |
1885 | <varlistentry> | |
1886 | <term> | |
1887 | <option>LXC_CONSOLE_LOGPATH</option> | |
1888 | </term> | |
1889 | <listitem> | |
1890 | <para> | |
1891 | <!-- | |
1892 | The path to the console log output of the container if not NULL. | |
1893 | [<option>-L</option>] | |
1894 | --> | |
dc421f3a | 1895 | 設定されている場合のコンテナのコンソールログ出力のパス。 |
fb261f53 KY |
1896 | [<option>-L</option>] |
1897 | </para> | |
1898 | </listitem> | |
1899 | </varlistentry> | |
1900 | </variablelist> | |
1901 | <variablelist> | |
1902 | <varlistentry> | |
1903 | <term> | |
1904 | <option>LXC_ROOTFS_MOUNT</option> | |
1905 | </term> | |
1906 | <listitem> | |
1907 | <para> | |
1908 | <!-- | |
1909 | The mount location to which the container is initially bound. | |
1910 | This will be the host relative path to the container rootfs | |
1911 | for the container instance being started and is where changes | |
1912 | should be made for that instance. | |
1913 | [<option>lxc.rootfs.mount</option>] | |
1914 | --> | |
dc421f3a KY |
1915 | 初期にコンテナがマウントされる場所。 |
1916 | これは、コンテナインスタンスが起動するためのコンテナの rootfs へのホスト上のパスであり、インスタンスのための移行が行われる場所です。 | |
fb261f53 KY |
1917 | [<option>lxc.rootfs.mount</option>] |
1918 | </para> | |
1919 | </listitem> | |
1920 | </varlistentry> | |
1921 | </variablelist> | |
1922 | <variablelist> | |
1923 | <varlistentry> | |
1924 | <term> | |
1925 | <option>LXC_ROOTFS_PATH</option> | |
1926 | </term> | |
1927 | <listitem> | |
1928 | <para> | |
1929 | <!-- | |
1930 | The host relative path to the container root which has been | |
1931 | mounted to the rootfs.mount location. | |
1932 | [<option>lxc.rootfs</option>] | |
1933 | --> | |
dc421f3a | 1934 | rootfs.mount へマウントされるコンテナのルートへのホスト上のパスです。 |
fb261f53 KY |
1935 | </para> |
1936 | </listitem> | |
1937 | </varlistentry> | |
1938 | </variablelist> | |
1939 | ||
1940 | </refsect2> | |
1941 | ||
1942 | <refsect2> | |
1943 | <title><!-- Logging -->ロギング</title> | |
1944 | <para> | |
1945 | <!-- | |
1946 | Logging can be configured on a per-container basis. By default, | |
1947 | depending upon how the lxc package was compiled, container startup | |
1948 | is logged only at the ERROR level, and logged to a file named after | |
1949 | the container (with '.log' appended) either under the container path, | |
1950 | or under @LOGPATH@. | |
1951 | --> | |
dc421f3a KY |
1952 | ロギングはコンテナごとに設定することが可能です。 |
1953 | デフォルトでは、lxc パッケージのコンパイル条件に依存し、コンテナのスタートアップは ERROR レベルでのみロギングされ、コンテナのパス以下か、@LOGPATH@ 以下のどちらかにコンテナ名 (の後に '.log' が付与される) をもとにした名前でロギングされます。 | |
fb261f53 KY |
1954 | </para> |
1955 | <para> | |
1956 | <!-- | |
1957 | Both the default log level and the log file can be specified in the | |
1958 | container configuration file, overriding the default behavior. Note | |
1959 | that the configuration file entries can in turn be overridden by the | |
1960 | command line options to <command>lxc-start</command>. | |
1961 | --> | |
dc421f3a KY |
1962 | デフォルトのログレベルとログファイルは両方とも、コンテナの設定ファイル内で指定され、デフォルトの値を上書きします。 |
1963 | 同様に、設定ファイルのエントリは <command>lxc-start</command> のコマンドラインオプションで上書きすることも可能です。 | |
fb261f53 KY |
1964 | </para> |
1965 | <variablelist> | |
1966 | <varlistentry> | |
1967 | <term> | |
1968 | <option>lxc.loglevel</option> | |
1969 | </term> | |
1970 | <listitem> | |
1971 | <para> | |
1972 | <!-- | |
1973 | The level at which to log. The log level is an integer in | |
1974 | the range of 0..8 inclusive, where a lower number means more | |
1975 | verbose debugging. In particular 0 = trace, 1 = debug, 2 = | |
1976 | info, 3 = notice, 4 = warn, 5 = error, 6 = critical, 7 = | |
1977 | alert, and 8 = fatal. If unspecified, the level defaults | |
1978 | to 5 (error), so that only errors and above are logged. | |
1979 | --> | |
dc421f3a KY |
1980 | ログを取得するレベル。 |
1981 | ログレベルは 0..8 の範囲の整数です。 | |
1982 | 数字が小さいほど冗長なデバッグを意味します。 | |
1983 | 具体的には、0 = trace, 1 = debug, 2 = info, 3 = notice, 4 = warn, 5 = error, 6 = critical, 7 = alert, and 8 = fatal です。 | |
1984 | 指定されない場合、レベルのデフォルトは 5 (error) で、それ以上のエラーがロギングされます。 | |
fb261f53 KY |
1985 | </para> |
1986 | <para> | |
1987 | <!-- | |
1988 | Note that when a script (such as either a hook script or a | |
1989 | network interface up or down script) is called, the script's | |
1990 | standard output is logged at level 1, debug. | |
1991 | --> | |
dc421f3a | 1992 | (フックスクリプトやネットワークインターフェースの起動、停止時のスクリプトのような) スクリプトが呼ばれた時、スクリプトの標準出力は level 1 の debug でロギングされます。 |
fb261f53 KY |
1993 | </para> |
1994 | </listitem> | |
1995 | </varlistentry> | |
1996 | <varlistentry> | |
1997 | <term> | |
1998 | <option>lxc.logfile</option> | |
1999 | </term> | |
2000 | <listitem> | |
2001 | <para> | |
2002 | <!-- | |
2003 | The file to which logging info should be written. | |
2004 | --> | |
dc421f3a | 2005 | ログ情報を書き込むファイル。 |
fb261f53 KY |
2006 | </para> |
2007 | </listitem> | |
2008 | </varlistentry> | |
2009 | </variablelist> | |
2010 | </refsect2> | |
2011 | ||
2012 | <refsect2> | |
2013 | <title><!-- Autostart -->自動起動</title> | |
2014 | <para> | |
2015 | <!-- | |
2016 | The autostart options support marking which containers should be | |
2017 | auto-started and in what order. These options may be used by LXC tools | |
2018 | directly or by external tooling provided by the distributions. | |
2019 | --> | |
dc421f3a KY |
2020 | 自動起動オプションでは、自動起動させるコンテナと順番の設定が可能です。 |
2021 | このオプションは LXC ツールが直接使用するか、ディストリビューションが提供する外部ツールが使用するかもしれません。 | |
fb261f53 KY |
2022 | </para> |
2023 | ||
2024 | <variablelist> | |
2025 | <varlistentry> | |
2026 | <term> | |
2027 | <option>lxc.start.auto</option> | |
2028 | </term> | |
2029 | <listitem> | |
2030 | <para> | |
2031 | <!-- | |
2032 | Whether the container should be auto-started. | |
2033 | Valid values are 0 (off) and 1 (on). | |
2034 | --> | |
dc421f3a KY |
2035 | コンテナを自動起動させるかどうかを設定します。 |
2036 | 有効な値は 0(オフ) か 1(オン) です。 | |
fb261f53 KY |
2037 | </para> |
2038 | </listitem> | |
2039 | </varlistentry> | |
2040 | <varlistentry> | |
2041 | <term> | |
2042 | <option>lxc.start.delay</option> | |
2043 | </term> | |
2044 | <listitem> | |
2045 | <para> | |
2046 | <!-- | |
2047 | How long to wait (in seconds) after the container is | |
2048 | started before starting the next one. | |
2049 | --> | |
dc421f3a | 2050 | コンテナを起動させた後、次のコンテナを起動させるまでにどれくらい (秒) 待つかを設定します。 |
fb261f53 KY |
2051 | </para> |
2052 | </listitem> | |
2053 | </varlistentry> | |
2054 | <varlistentry> | |
2055 | <term> | |
2056 | <option>lxc.start.order</option> | |
2057 | </term> | |
2058 | <listitem> | |
2059 | <para> | |
2060 | <!-- | |
2061 | An integer used to sort the containers when auto-starting | |
2062 | a series of containers at once. | |
2063 | --> | |
dc421f3a | 2064 | 多数の自動起動させるコンテナがある場合のコンテナの起動順を決めるのに使う整数を指定します。 |
fb261f53 KY |
2065 | </para> |
2066 | </listitem> | |
2067 | </varlistentry> | |
2068 | <varlistentry> | |
2069 | <term> | |
2070 | <option>lxc.group</option> | |
2071 | </term> | |
2072 | <listitem> | |
2073 | <para> | |
2074 | <!-- | |
2075 | A multi-value key (can be used multiple times) to put the | |
2076 | container in a container group. Those groups can then be | |
2077 | used (amongst other things) to start a series of related | |
2078 | containers. | |
2079 | --> | |
dc421f3a KY |
2080 | コンテナを追加したいコンテナグループ名を指定します。 |
2081 | (複数回使用される可能性のある) 複数の値を設定可能です。 | |
2082 | 設定されたグループは、関連する一連のコンテナを起動させるために使われます。 | |
fb261f53 KY |
2083 | </para> |
2084 | </listitem> | |
2085 | </varlistentry> | |
2086 | </variablelist> | |
2087 | </refsect2> | |
2088 | ||
f57517ef KY |
2089 | <refsect2> |
2090 | <title><!-- Autostart and System Boot -->自動起動とシステムブート</title> | |
2091 | <para> | |
2092 | <!-- | |
2093 | Each container can be part of any number of groups or no group at all. | |
2094 | Two groups are special. One is the NULL group, i.e. the container does | |
2095 | not belong to any group. The other group is the "onboot" group. | |
2096 | --> | |
2097 | コンテナはいくつでもグループに属することができ、全く属さないことも可能です。特別なグループが 2 つ存在します。1 つは NULL グループです。これはどのグループにも属さないコンテナです。もう 1 つは "onboot" グループです。 | |
2098 | </para> | |
2099 | ||
2100 | <para> | |
2101 | <!-- | |
2102 | When the system boots with the LXC service enabled, it will first | |
2103 | attempt to boot any containers with lxc.start.auto == 1 that is a member | |
2104 | of the "onboot" group. The startup will be in order of lxc.start.order. | |
2105 | If an lxc.start.delay has been specified, that delay will be honored | |
2106 | before attempting to start the next container to give the current | |
2107 | container time to begin initialization and reduce overloading the host | |
2108 | system. After starting the members of the "onboot" group, the LXC system | |
2109 | will proceed to boot containers with lxc.start.auto == 1 which are not | |
2110 | members of any group (the NULL group) and proceed as with the onboot | |
2111 | group. | |
2112 | --> | |
2113 | LXC サービスが有効になった状態でシステムがブートすると、最初に "onboot" グループのメンバーである lxc.start.auto == 1 が設定されたコンテナを起動しようとします。起動は lxc.start.order の順に起動します。 | |
2114 | lxc.start.delay が指定されている場合、現在対象となっているコンテナに初期化の時間を与え、ホストシステムの負荷を低減するために、次のコンテナを開始させるまでに遅延時間を与えます。 | |
2115 | "onboot" グループのメンバーが開始した後、LXC システムは lxc.start.auto == 1 が設定された、どのグループのメンバーでもない (NULL グループの) コンテナのブートを onboot グループのコンテナと同様に開始します。 | |
2116 | </para> | |
2117 | ||
2118 | </refsect2> | |
fb261f53 KY |
2119 | </refsect1> |
2120 | ||
2121 | <refsect1> | |
2122 | <title><!-- Examples -->例</title> | |
2123 | <para> | |
2124 | <!-- | |
2125 | In addition to the few examples given below, you will find | |
2126 | some other examples of configuration file in @DOCDIR@/examples | |
2127 | --> | |
dc421f3a | 2128 | 以下に紹介するいくつかの例に加えて、他の設定例が @DOCDIR@/examples にあります。 |
fb261f53 KY |
2129 | </para> |
2130 | <refsect2> | |
2131 | <title><!-- Network -->ネットワーク</title> | |
2132 | <para> | |
2133 | <!-- | |
2134 | This configuration sets up a container to use a veth pair | |
2135 | device with one side plugged to a bridge br0 (which has been | |
2136 | configured before on the system by the administrator). The | |
2137 | virtual network device visible in the container is renamed to | |
2138 | eth0. | |
2139 | --> | |
dc421f3a KY |
2140 | この設定は、片方をブリッジである br0 と接続される veth ペアデバイスを使うコンテナを設定します (ブリッジは管理者によりあらかじめシステム上に設定済みである必要があります)。 |
2141 | 仮想ネットワークデバイスは、コンテナ内では eth0 とリネームされます。 | |
fb261f53 KY |
2142 | </para> |
2143 | <programlisting> | |
2144 | lxc.utsname = myhostname | |
2145 | lxc.network.type = veth | |
2146 | lxc.network.flags = up | |
2147 | lxc.network.link = br0 | |
2148 | lxc.network.name = eth0 | |
2149 | lxc.network.hwaddr = 4a:49:43:49:79:bf | |
2150 | lxc.network.ipv4 = 1.2.3.5/24 1.2.3.255 | |
2151 | lxc.network.ipv6 = 2003:db8:1:0:214:1234:fe0b:3597 | |
2152 | </programlisting> | |
2153 | </refsect2> | |
2154 | ||
2155 | <refsect2> | |
2156 | <title><!-- UID/GID mapping -->UID/GID のマッピング</title> | |
2157 | <para><!-- This configuration will map both user and group ids in the | |
2158 | range 0-9999 in the container to the ids 100000-109999 on the host. --> | |
dc421f3a | 2159 | この設定は、コンテナ内のユーザとグループ両方の id 0-9999 の範囲を、ホスト上の 100000-109999 へマッピングします。 |
fb261f53 KY |
2160 | </para> |
2161 | <programlisting> | |
2162 | lxc.id_map = u 0 100000 10000 | |
2163 | lxc.id_map = g 0 100000 10000 | |
2164 | </programlisting> | |
2165 | </refsect2> | |
2166 | ||
2167 | <refsect2> | |
2168 | <title>Control group</title> | |
2169 | <para> | |
2170 | <!-- This configuration will setup several control groups for | |
2171 | the application, cpuset.cpus restricts usage of the defined cpu, | |
2172 | cpus.share prioritize the control group, devices.allow makes | |
2173 | usable the specified devices.--> | |
dc421f3a KY |
2174 | この設定は、アプリケーションのための control group をいくつか設定します。 |
2175 | cpuset.cpus は定義された cpu のみ使用できるように制限します。 | |
2176 | cpus.share は、control group の (cpu) 優先度を指定します。 | |
2177 | devices.allow は、特定のデバイスを使用可能にします。 | |
fb261f53 KY |
2178 | </para> |
2179 | <programlisting> | |
2180 | lxc.cgroup.cpuset.cpus = 0,1 | |
2181 | lxc.cgroup.cpu.shares = 1234 | |
2182 | lxc.cgroup.devices.deny = a | |
2183 | lxc.cgroup.devices.allow = c 1:3 rw | |
2184 | lxc.cgroup.devices.allow = b 8:0 rw | |
2185 | </programlisting> | |
2186 | </refsect2> | |
2187 | ||
2188 | <refsect2> | |
2189 | <title><!-- Complex configuration -->複雑な設定</title> | |
2190 | <para> | |
2191 | <!-- This example show a complex configuration making a complex | |
2192 | network stack, using the control groups, setting a new hostname, | |
2193 | mounting some locations and a changing root file system. --> | |
dc421f3a | 2194 | この例は、control group を使って、複雑なネットワークスタックを作成し、新しいホスト名を指定し、いくつかの場所をマウントし、ルートファイルシステムを変更するような複雑な設定を示します。 |
fb261f53 KY |
2195 | </para> |
2196 | <programlisting> | |
2197 | lxc.utsname = complex | |
2198 | lxc.network.type = veth | |
2199 | lxc.network.flags = up | |
2200 | lxc.network.link = br0 | |
2201 | lxc.network.hwaddr = 4a:49:43:49:79:bf | |
2202 | lxc.network.ipv4 = 10.2.3.5/24 10.2.3.255 | |
2203 | lxc.network.ipv6 = 2003:db8:1:0:214:1234:fe0b:3597 | |
2204 | lxc.network.ipv6 = 2003:db8:1:0:214:5432:feab:3588 | |
2205 | lxc.network.type = macvlan | |
2206 | lxc.network.flags = up | |
2207 | lxc.network.link = eth0 | |
2208 | lxc.network.hwaddr = 4a:49:43:49:79:bd | |
2209 | lxc.network.ipv4 = 10.2.3.4/24 | |
2210 | lxc.network.ipv4 = 192.168.10.125/24 | |
2211 | lxc.network.ipv6 = 2003:db8:1:0:214:1234:fe0b:3596 | |
2212 | lxc.network.type = phys | |
2213 | lxc.network.flags = up | |
2214 | lxc.network.link = dummy0 | |
2215 | lxc.network.hwaddr = 4a:49:43:49:79:ff | |
2216 | lxc.network.ipv4 = 10.2.3.6/24 | |
2217 | lxc.network.ipv6 = 2003:db8:1:0:214:1234:fe0b:3297 | |
2218 | lxc.cgroup.cpuset.cpus = 0,1 | |
2219 | lxc.cgroup.cpu.shares = 1234 | |
2220 | lxc.cgroup.devices.deny = a | |
2221 | lxc.cgroup.devices.allow = c 1:3 rw | |
2222 | lxc.cgroup.devices.allow = b 8:0 rw | |
2223 | lxc.mount = /etc/fstab.complex | |
2224 | lxc.mount.entry = /lib /root/myrootfs/lib none ro,bind 0 0 | |
2225 | lxc.rootfs = /mnt/rootfs.complex | |
2226 | lxc.cap.drop = sys_module mknod setuid net_raw | |
2227 | lxc.cap.drop = mac_override | |
2228 | </programlisting> | |
2229 | </refsect2> | |
2230 | ||
2231 | </refsect1> | |
2232 | ||
2233 | <refsect1> | |
2234 | <title>See Also</title> | |
2235 | <simpara> | |
2236 | <citerefentry> | |
2237 | <refentrytitle><command>chroot</command></refentrytitle> | |
2238 | <manvolnum>1</manvolnum> | |
2239 | </citerefentry>, | |
2240 | ||
2241 | <citerefentry> | |
2242 | <refentrytitle><command>pivot_root</command></refentrytitle> | |
2243 | <manvolnum>8</manvolnum> | |
2244 | </citerefentry>, | |
2245 | ||
2246 | <citerefentry> | |
2247 | <refentrytitle><filename>fstab</filename></refentrytitle> | |
2248 | <manvolnum>5</manvolnum> | |
2249 | </citerefentry> | |
2250 | ||
2251 | <citerefentry> | |
2252 | <refentrytitle><filename>capabilities</filename></refentrytitle> | |
2253 | <manvolnum>7</manvolnum> | |
2254 | </citerefentry> | |
2255 | ||
2256 | </simpara> | |
2257 | </refsect1> | |
2258 | ||
2259 | &seealso; | |
2260 | ||
2261 | <refsect1> | |
2262 | <title><!-- Author -->作者</title> | |
2263 | <para>Daniel Lezcano <email>daniel.lezcano@free.fr</email></para> | |
2264 | </refsect1> | |
2265 | ||
2266 | </refentry> | |
2267 | ||
2268 | <!-- Keep this comment at the end of the file | |
2269 | Local variables: | |
2270 | mode: sgml | |
2271 | sgml-omittag:t | |
2272 | sgml-shorttag:t | |
2273 | sgml-minimize-attributes:nil | |
2274 | sgml-always-quote-attributes:t | |
2275 | sgml-indent-step:2 | |
2276 | sgml-indent-data:t | |
2277 | sgml-parent-document:nil | |
2278 | sgml-default-dtd-file:nil | |
2279 | sgml-exposed-tags:nil | |
2280 | sgml-local-catalogs:nil | |
2281 | sgml-local-ecat-files:nil | |
2282 | End: | |
2283 | --> |