Scripts and notes for running one docker-compose.yml
application using
Docker Compose inside an unprivileged LXC
container, on
Proxmox Virtual Environment (PVE).
Use this if you want:
- one unprivileged LXC container per one application (one
docker-compose.yml
) - a bind-mounted directory into each container/application, where
- its
docker-compose.yml
lives there - its configuration lives there
- its data lives there
- its
This means, that to deploy a new application, you...
- run the script
create-docker-ct
with the name of your new application as argument, - create or download its
docker-compose.yml
file into the directory the script tells you, - start the newly created LXC container.
- Install PVE (for example via https://github.com/hugojosefson/proxmox-root-on-encrypted-zfs).
curl -sSfL https://github.com/hugojosefson/proxmox-create-docker-ct/tarball/main \
| tar -xzvC /usr/local/bin --wildcards "*/usr_local_bin/" --strip-components=2
USAGE:
create-docker-ct --help This help message
create-docker-ct <name> Create a CT from alpine-3.18-default_20230607_amd64.tar.xz
create-docker-ct <name> [<base_template_filename>] Create a CT from specified base template
EXAMPLE:
create-docker-ct my-service
create-docker-ct my-service alpine-3.18-default_20230607_amd64.tar.xz
create-docker-ct my-service ubuntu-22.04-standard_22.04-1_amd64.tar.zst
create-docker-ct my-service debian-12-standard_12.0-1_amd64.tar.zst
Run this script:
create-docker-ct <name>
...where <name>
is the name of the app.
The application's name will be its directory name, and its hostname.
The script will output:
- the app CT's VMID number, and
- the directory mounted as
/appdata
inside the CT, where itsdocker-compose.yml
etc. lives.
Edit the CT's docker-compose.yml
file, or overwrite it with what you want to
deploy.
Start or restart the app CT:
pct start <vmid>
pct restart <vmid>