Dodal containerje

main
Gasper Spagnolo 2022-09-27 13:01:44 +02:00
parent 5e9eea49ef
commit ec45256cd8
1 changed files with 21 additions and 0 deletions

21
lxc.md
View File

@ -37,3 +37,24 @@ to delete a container:
### Exposing container to the public:
Todo, for now follow linked tutorial. Host it on your own.
### Running Docker inside lxc:
Firstly you need to create storage device:
```bash
lxc sorage create <volume-name> btrfs
lxc launch images:ubuntu/22.04 <container-name>
```
Then add this storage device to container:
```bash
lxc config device add <container-name> docker disk pool=<volume-name> source=<container-name> path=/var/lib/docker
```
Then set privileges for docker to have ability to call syscalls.
```bash
lxc config set <container-name> security.nesting=true security.syscalls.intercept.mknod=true security.syscalls.intercept.setxattr=true
lxc restart <container-name>
```