jpprojects

Proxmox Docker

Docker VM

Docker is one of, if not the most popular containerization platform. It’s open source and free to use, used to create and manage containers (low resource, lightweight, very fast “VMs”). Thing is, Docker is not, itself, an operating system. So for this machine, a lightweight, CLI only install of Debian is used as the host environmnet for Docker. This adds a dimension of complication and locks the machine to CLI only in exchange for being very lightweight and fast.

This page is in 2 parts: first for creating the Debian VM and then installing and using Docker.


Part 1 : Debian CLI VM

1. Download the Debian ISO

We will be using Debian 12 (debian-12.0.0-amd64-netinst.iso)

2. Upload the ISO

Make sure you see the iso listed.

3. Create the VM

This has a lot of steps, but there is some room for error. These configurations are organized by section/tab:

4. Finish the Installation

Follow these steps for post-creation installation options. Most are pretty predictable, but some are not. Safest to just follow along.

All done! Finally.

5. Install the QEMU Guest Agent

See the Proxmox Scripting project page, step 2, for instructions on how to do this.

6. Install OpenSSH

See OpenSSH project page for instructions on how to do this.


Part 2 : Docker CLI

1. SSH in

SSH in, as these steps require lots of copy and pasting, easiest done from SSH rather than directly in the Proxmox Web GUI. Log in as root, or a user with root priviledge, or as a normal user and then su to a user with sudo.

Remeber, this is done with `ssh username@ip`. Find the Debian VM's IP address with `ip a`, it will likely be the last one listed.

2. Install Docker

This is where the copy and pasting is going to be very handy.

The VM may come without `tee`. Run `apt install coreutils sudo -y` to install it.

3. Allow user to run Docker

This allows the current user to run Docker without sudo. Run newgrp docker, then sudo usermod -aG docker $USER.

Test that everything is working by running docker run hello-world. Output should be see a message that says Hello from Docker!.

4. Finishing touches

First, check that auto-start is enabled (which is the default, but good to check). - sudo systemctl enable docker - sudo systemctl enable containerd

Second, organize the Docker stuff for a clean layout: - Make a Docker directory : sudo mkdir -p /opt/docker - Switch owner of the directory : sudo chown -R $USER:$USER /opt/docker


How to Docker CLI

It isn’t totally intuitive, but it isn’t too tricky either.