meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
vm:proxmox:lxc [2020/05/02 19:00] – niziak | vm:proxmox:lxc [2021/02/22 07:18] (current) – niziak | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== LXC ====== | ====== LXC ====== | ||
- | ===== docker inside unprivileged LXC ===== | + | ===== rename CT ===== |
+ | <code bash>pct set < | ||
- | Docker is recommended to be used inside VM. | + | ===== update CT templates |
- | + | ||
- | From documentation: | + | |
- | + | ||
- | * edit LXC container config | + | |
- | <file | / | + | |
- | features: | + | |
- | </ | + | |
- | * stop/start LXC container | + | |
- | * <code bash> | + | |
- | + | ||
- | ==== issue ==== | + | |
- | === VFS FS is used by docker. === | + | |
- | + | ||
- | + | ||
- | The vfs backend is a very simple fallback that has no copy-on-write support. Each layer is just a separate directory. Creating a new layer based on another layer is done by making a deep copy of the base layer into a new directory. | + | |
- | Since this backend doesn’t share diskspace use between layers, and since creating a new layer is a slow operation this is not a very practical backend. However, it still has its uses, for instance to verify other backends against, or if you need a super robust (if slow) backend that works everywhere. | + | |
- | | + | |
<code bash> | <code bash> | ||
- | docker info | + | # pveam - Proxmox VE Appliance Manager |
- | ... | + | pveam update |
- | | + | |
- | | + | |
- | ... | + | |
</ | </ | ||
- | When restarted in privileged container: | ||
- | NOTE: restarting in privileged container do mess with user permission. Make backup/ | ||
- | <code bash> | + | ===== Shrink container disc ===== |
- | docker info | + | |
- | ... | + | |
- | | + | |
- | Root Dir: / | + | |
- | Backing Filesystem: zfs | + | |
- | Dirs: 0 | + | |
- | Dirperm1 Supported: true | + | |
- | ... | + | |
- | </ | + | |
- | + | ||
- | Solution: | + | |
- | <code bash> | + | |
- | cp / | + | |
- | </ | + | |
- | + | ||
- | Edit new file and update '' | + | |
- | + | ||
- | < | + | |
- | # Do not load this file. Rather, load / | + | |
- | # will source all profiles under / | + | |
- | + | ||
- | profile lxc-container-default-with-nesting-docker flags=(attach_disconnected, | + | |
- | #include < | + | |
- | #include < | + | |
- | + | ||
- | deny / | + | |
- | deny / | + | |
- | mount fstype=proc -> / | + | |
- | mount fstype=sysfs -> / | + | |
- | mount options=(rw, | + | |
- | mount fstype=cgroup -> / | + | |
- | mount fstype=cgroup2 -> / | + | |
- | mount fstype=aufs, | + | |
- | mount fstype=overlay, | + | |
- | } | + | |
- | </ | + | |
- | <code bash>systemctl reload apparmor</ | + | It is not supported. Command |
- | Edit '' | + | Workaround 1: |
- | <file | / | + | * Stop container |
- | lxc.apparmor.profile: | + | * Edit '' |
- | < | + | * Perform backup |
+ | * Restore LXC from backup | ||
+ | Workaround 2: | ||
+ | * Change ZFS volume size <code bash>zfs set refquota=8G rpool/ | ||
+ | * Adjust LXC config: | ||
+ | * Edit ''< | ||
+ | * '' | ||