Files
git.limbosolutions.com/documentation/setup-lxc.md

1.5 KiB

LXC Setup

Install

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

LXC_CONTAINER_NAME=gitsrv01
LXC_PROFILE=default

then execute

## Create ubuntu container
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


## update ubuntu container
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"

#Setup Portainer
lxc exec $LXC_CONTAINER_NAME -- bash -c "curl -s \"https://git.limbosolutions.com/kb/portainer/raw/branch/main/scripts/setup.sh\" | bash"

#confirm container ip address
lxc exec $LXC_CONTAINER_NAME -- bash -c "ip a"

lxc restart $LXC_CONTAINER_NAME

Check instalation

From other computer

 ping $LXC_CONTAINER_NAME 

Access portainer (https://$LXC_CONTAINER_NAME:9443/) for inicial setup:

  • Setup administration username and password

Remove

 lxc rm $LXC_CONTAINER_NAME --force