documentation review
This commit is contained in:
58
README.md
58
README.md
@@ -1,2 +1,60 @@
|
|||||||
# lxc
|
# lxc
|
||||||
|
|
||||||
|
[TOC]
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
|
||||||
|
sudo usermod -a -G lxd $(whoami)
|
||||||
|
|
||||||
|
## Containers
|
||||||
|
|
||||||
|
### List
|
||||||
|
|
||||||
|
```bash
|
||||||
|
lxc list
|
||||||
|
```
|
||||||
|
|
||||||
|
### Get Info
|
||||||
|
|
||||||
|
```bash
|
||||||
|
lxc info containername
|
||||||
|
```
|
||||||
|
|
||||||
|
### Create
|
||||||
|
|
||||||
|
```bash
|
||||||
|
lxc launch ubuntu containername
|
||||||
|
```
|
||||||
|
|
||||||
|
### Stop
|
||||||
|
|
||||||
|
```bash
|
||||||
|
lxc stop containername
|
||||||
|
```
|
||||||
|
|
||||||
|
Exec bash on container
|
||||||
|
|
||||||
|
```bash
|
||||||
|
lxc exec $containername bash
|
||||||
|
```
|
||||||
|
|
||||||
|
### Exec multiple commands
|
||||||
|
|
||||||
|
lxc exec $containername -- bash -c "apt update -y && apt upgrade -y"
|
||||||
|
|
||||||
|
### delete a container
|
||||||
|
|
||||||
|
```bash
|
||||||
|
lxc rm containername
|
||||||
|
#if force required
|
||||||
|
lxc rm containername --force
|
||||||
|
```
|
||||||
|
|
||||||
|
### Configuration
|
||||||
|
|
||||||
|
Edit
|
||||||
|
|
||||||
|
```bash
|
||||||
|
lxc config edit $CONTAINER_NAME
|
||||||
|
```
|
||||||
|
|||||||
@@ -9,15 +9,9 @@ on a lxc container
|
|||||||
- security.nesting: "true"
|
- security.nesting: "true"
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
lxc config edit ${CONTAINER_NAME}
|
lxc config set $CONTAINER_NAME "security.nesting" "true"
|
||||||
```
|
```
|
||||||
|
|
||||||
### setup ubuntu container
|
### setup ubuntu container
|
||||||
|
|
||||||
```bash
|
Install docker with fuse fs [more information] (/kb/docker)
|
||||||
apt-get install --yes fuse-overlayfs
|
|
||||||
cd ~/
|
|
||||||
curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh
|
|
||||||
docker run hello-world
|
|
||||||
docker info
|
|
||||||
```
|
|
||||||
|
|||||||
Reference in New Issue
Block a user