Setting up Cloud-Init
- Set user to root
- Give root user a password
- Set to no (not enough storage, yet)
- Set network settings
- Regenerate Image
Now you can start the VM
Select xterm.js under the Console pull down for copy/paste functions
Resize the Bootdisk (/dev/sda)
Hardware > Hard Disk (scsi0) > Disk Action > Resize
Expand VM Disk using parted (/dev/sda1)
parted /dev/sda
resizepart 1
Fix/Ignore? Fix
Partition number? 1
Yes/No? Yes
End? [2146MB]? -0
(parted) quit
reboot
Get SSH Going
sed -i -e 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' -e 's/^PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config
rm /etc/ssh/sshd_config.d/60-cloudimg-settings.conf
systemctl restart sshd
Add Guest Agent
apt-get update && apt-get -y upgrade
apt-get install -y qemu-guest-agent
reboot
Install Docker
sh <(curl -sSL https://get.docker.com)
Install Docker Compose
LATEST=$(curl -sL https://api.github.com/repos/docker/compose/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -sSL https://github.com/docker/compose/releases/download/$LATEST/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
docker compose version
Add Dockge
- Install Docker Compose first
mkdir -p /opt/{dockge,stacks}
wget -q -O /opt/dockge/compose.yaml https://raw.githubusercontent.com/louislam/dockge/master/compose.yaml
cd /opt/dockge
docker compose up -d
Dockge GUI, https:// IP:5001
Add Portainer
- Docker run
docker volume create portainer_data
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
Portainer GUI, https:// IP:9443