52 lines
1.1 KiB
Markdown
52 lines
1.1 KiB
Markdown
# Setup
|
|
|
|
## Host LXC Container
|
|
|
|
``` bash
|
|
#set vars
|
|
containername=gitsrv01
|
|
```
|
|
|
|
### Create Container
|
|
|
|
```bash
|
|
lxc launch ubuntu $containername -p enxd0374555c1f8_macvlan && \
|
|
lxc config set $containername "security.nesting" "true" && \
|
|
lxc exec $containername -- bash -c "apt update -y && apt upgrade -y && apt install --yes fuse-overlayfs" && \
|
|
lxc exec $containername -- bash -c "cd ~/ && curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh" && \
|
|
|
|
```
|
|
|
|
For more information:
|
|
|
|
- [LXC/Docker](/kb/lxc/documentation/running-docker.md)
|
|
|
|
#### Portainer
|
|
|
|
##### Create
|
|
|
|
```bash
|
|
lxc exec $containername -- bash -c "docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest" && \
|
|
lxc exec $containername -- bash -c "docker container list"
|
|
```
|
|
|
|
##### Remove
|
|
|
|
```bash
|
|
lxc exec $containername -- bash -c "docker rm portainer --force"
|
|
```
|
|
|
|
For more information:
|
|
|
|
- [Install Portainer](/kb/portainer/)
|
|
|
|
### Remove
|
|
|
|
```bash
|
|
lxc rm $containername --force
|
|
```
|
|
|
|
## Setup Gitea
|
|
|
|
Setup using [docker compose](docker/docker-compose.yaml).
|