This commit is contained in:
2022-10-08 12:49:12 +01:00
parent 6c4cbc7fed
commit 3efef96fa6
5 changed files with 92 additions and 79 deletions

View File

@@ -1,18 +1,26 @@
# LXD
# LXC Setup
## Setup
## Install
set variables required for setup
### Requirements
- Currently hosted using macvlan network
- Instructions are provided for $LXC_PROFILE defined as macvlan
_For more information how to setup a lxc profile with macvlan network https://git.limbosolutions.com/kb/lxc_
Replace and execute on bash
```bash
LXC_CONTAINER_NAME=samplename
LXC_CONTAINER_NAME=gitsrv01
LXC_PROFILE=default
```
then execute
```bash
## Create ubuntu container
lxc launch ubuntu $LXC_CONTAINER_NAME
lxc launch ubuntu $LXC_CONTAINER_NAME -p $LXC_PROFILE
## Setup container for docker
curl -s "https://git.limbosolutions.com/kb/lxc/raw/branch/main/scripts/lxc-config-docker-requirements.sh" | bash -s $LXC_CONTAINER_NAME
@@ -24,6 +32,9 @@ lxc exec $LXC_CONTAINER_NAME -- bash -c "apt update -y && apt upgrade -y"
## Install fuse and docker on lxc container
lxc exec $LXC_CONTAINER_NAME -- bash -c "curl -s \"https://git.limbosolutions.com/kb/docker/raw/branch/main/scripts/ubuntu-fuse-setup.sh\" | bash"
## Check docker for fusefs
lxc exec $LXC_CONTAINER_NAME -- bash -c "docker info"
#install Portainer
lxc exec $LXC_CONTAINER_NAME -- bash -c "curl -s \"https://git.limbosolutions.com/kb/portainer/raw/branch/main/scripts/setup.sh\" | bash"
@@ -31,3 +42,21 @@ lxc exec $LXC_CONTAINER_NAME -- bash -c "curl -s \"https://git.limbosolutions.co
lxc exec $LXC_CONTAINER_NAME -- bash -c "ip a"
```
### Check instalation
From other computer
```bash
ping http://$LXC_CONTAINER_NAME:9000
```
Access portainer (http://$LXC_CONTAINER_NAME:9000_) for inicial setup:
- Setup administration username and password
## Remove
```bash
lxc rm $LXC_CONTAINER_NAME --force
```