mirror of
https://github.com/bashclub/proxmox-zfs-postinstall.git
synced 2024-11-07 18:31:58 +01:00
35 lines
1.2 KiB
Bash
35 lines
1.2 KiB
Bash
#!/bin/bash
|
|
|
|
# create zfs filesystems
|
|
zfs create -o com.sun:auto-snapshot=false -o mountpoint=/var/lib/docker rpool/docker
|
|
zfs create -o com.sun:auto-snapshot=true -o mountpoint=/portainer rpool/portainer
|
|
|
|
# add docker repository
|
|
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
|
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
|
|
|
# update package lists and install docker engine + docker-compose
|
|
apt update
|
|
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt install -y -qq --no-install-recommends docker-ce docker-ce-cli containerd.io docker-compose
|
|
|
|
# install portainer
|
|
cd /portainer
|
|
mkdir data
|
|
cat << EOF > /portainer/docker-compose.yml
|
|
version: '3.2'
|
|
|
|
services:
|
|
|
|
portainer:
|
|
image: portainer/portainer-ce
|
|
ports:
|
|
- "9443:9443"
|
|
- "8000:8000"
|
|
volumes:
|
|
- /portainer/data:/data
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
restart: always
|
|
EOF
|
|
# start portainer
|
|
docker-compose up -d
|