mirror of
https://github.com/bashclub/proxmox-zfs-postinstall.git
synced 2024-12-24 17:30:11 +01:00
Create install-docker-portainer
This commit is contained in:
parent
9b4b99dca4
commit
994001a7a3
34
install-docker-portainer
Normal file
34
install-docker-portainer
Normal file
@ -0,0 +1,34 @@
|
||||
#!/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
|
Loading…
Reference in New Issue
Block a user