User Tools

Site Tools


технология_lxc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
технология_lxc [2020/06/22 20:29]
val [Запуск/мониторинг/остановка контейнера]
технология_lxc [2022/07/28 12:21] (current)
val [Технология LXC]
Line 2: Line 2:
  
   * [[http://​ru.wikipedia.org/​wiki/​LXC|LXC wiki]]   * [[http://​ru.wikipedia.org/​wiki/​LXC|LXC wiki]]
-  * [[https://help.ubuntu.com/lts/serverguide/lxc.html|Ubuntu-Руководство по Ubuntu Server-Виртуализация]]+  * [[https://wiki.debian.org/LXC|debian.org/LXC]] 
 +  * [[https://​linuxcontainers.org/​lxc/​getting-started/​|LXC Getting started]]
  
  
Line 31: Line 32:
         gateway 192.168.X.1         gateway 192.168.X.1
         ​         ​
-#        ​bridge_ports eth0 +        ​bridge_ports eth0
-#        bridge_ports enp0s3+
  
 #        bridge_stp off #        bridge_stp off
Line 48: Line 48:
  
 root@server:​~#​ cat /​etc/​default/​lxc root@server:​~#​ cat /​etc/​default/​lxc
 +</​code><​code>​
 +...
 +#[ ! -f /​etc/​default/​lxc-net ] || . /​etc/​default/​lxc-net
 +</​code>​
  
 +  ИЛИ
 +
 +<​code>​
 root@server:​~#​ cat /​etc/​default/​lxc-net root@server:​~#​ cat /​etc/​default/​lxc-net
 </​code><​code>​ </​code><​code>​
Line 60: Line 67:
  
 ==== Создание ветки дочерней системы ==== ==== Создание ветки дочерней системы ====
 +
 +=== Debian ===
 <​code>​ <​code>​
 debian# lxc-create -t debian -n www debian# lxc-create -t debian -n www
 </​code>​ </​code>​
  
 +=== Ubuntu ===
 +<​code>​
 +ubuntu# lxc-create -t download -n www -- -d ubuntu -r focal -a amd64
 +</​code>​
 ==== Установка ПО в дочерней системе ==== ==== Установка ПО в дочерней системе ====
 <​code>​ <​code>​
Line 103: Line 116:
 </​code><​code>​ </​code><​code>​
 ... ...
-#​lxc.network.link = empty+
 lxc.net.0.type = veth lxc.net.0.type = veth
 lxc.net.0.link = br0 lxc.net.0.link = br0
Line 111: Line 124:
  
 lxc.start.auto = 1 lxc.start.auto = 1
-... 
 </​code><​code>​ </​code><​code>​
 root@server:​~#​ lxc-ls -f root@server:​~#​ lxc-ls -f
Line 123: Line 135:
  
 root@server:​~#​ lxc-attach -n www -- ps ax root@server:​~#​ lxc-attach -n www -- ps ax
 +  или
 +root@server:​~#​ ps -eo pid,cmd,lxc | grep www
 +
 root@server:​~#​ lxc-attach -n www -- /bin/bash root@server:​~#​ lxc-attach -n www -- /bin/bash
  
технология_lxc.1592846981.txt.gz · Last modified: 2020/06/22 20:29 by val