mkdocs-benoit.jp.net/HowtoLXD.page

76 lines
1.5 KiB
Text
Raw Normal View History

2017-08-21 19:49:14 +00:00
Some commands:
```
lxc image alias list images:
lxc info <name>
lxc config edit <name>
lxc config sonw <name>
lxc exec <name> bash
lxc config set <name> limits.memory 512MB
lxc config set <name> limits.cpu 2
lxc config device set <name> root size 20GB
lxc launch images:debian/stretch/amd64 <name>
lxc list
lxc storage volume list <storagename>
2017-10-02 15:58:27 +00:00
# mode privileged
lxc launch ubuntu:16.04 test -c security.privileged=true -c security.nesting=true
2020-05-05 07:03:50 +00:00
lxc config device add test ssh proxy listen=tcp:0.0.0.0:2222 connect=tcp:127.0.0.1:22
```
2017-09-13 19:46:28 +00:00
Chemins :
2020-05-05 03:29:16 +00:00
Normal : /var/lib/lxd/
Snap : /var/snap/lxd/common/lxd/
2017-09-13 19:46:28 +00:00
Paquets à installer pour se sentir à l'aise sur une Debian ou Ubuntu
```
2020-05-05 03:29:16 +00:00
vim logrotate
etckeeper
iputils-ping
2017-09-13 19:46:28 +00:00
dnsutils
```
2020-05-05 03:29:16 +00:00
N'est plus nécessaire sur les images récentes :
2017-09-26 20:37:09 +00:00
```
# systemctl disable getty@tty{1..4}
# reboot
```
2017-10-01 13:09:32 +00:00
- Activer journald
- Mettre le bon hostname
- Installer postfix
2017-09-13 19:46:28 +00:00
Paquets à installer pour se sentir à l'aise sur une Alpine
```
2020-05-05 03:29:16 +00:00
etckeeper
vim
2017-09-13 19:46:28 +00:00
```
```
2017-09-13 19:46:28 +00:00
sed -i 's/^tty/# tty/g' /etc/inittab
2017-09-13 19:46:28 +00:00
# clean messages
rm /var/log/messages
2018-01-10 21:23:59 +00:00
```
Nginx :
```
set_real_ip_from W.X.Y.Z;
2020-05-05 10:26:18 +00:00
#real_ip_recursive on;
2018-01-10 21:23:59 +00:00
real_ip_header X-Forwarded-For;
2020-05-05 10:26:18 +00:00
log_format custom '$http_x_forwarded_for - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
access_log /var/log/nginx/access.log custom;
2020-05-08 13:59:26 +00:00
```
Aller dans le namespace de LXD (snap0 pour faire des actions genre mount/umount :
```
# nsenter -t $(cat /var/snap/lxd/common/lxd.pid) -m
2017-09-13 19:46:28 +00:00
```