Bookmark

Build a Docker Host inside a Proxmox VE LXC with TurnKey Core

i12bretro tutorial 0595 places a Docker host inside a Proxmox VE Linux container (CT) using the TurnKey Core template. It downloads the template, creates a CT named Docker with 2048 MB RAM, updates the OS, installs Docker, and optionally adds Portainer.[10]

Youtube video player

This is the original tutorial video.[15]

1. Create the container

  1. Log into the Proxmox VE web UI.[10]
  2. Select a left-panel storage that permits Container templates.[10]
  3. Select CT Templates in the sub-navigation.[10]
  4. Click Templates.[10]
  5. Search for core, select TurnKey Core, and click Download.[10]
  6. Wait for the download to finish and close the download dialog.[10]
  7. Right-click the Proxmox node and choose Create CT.[10]
  8. Set Hostname to Docker, enter and confirm a password locally, then click Next.[10]
  9. Select the storage holding the template and choose the TurnKey Core template, then click Next.[10]
  10. Select the storage that will hold the container, then click Next.[10]
  11. On CPU, keep the defaults and click Next.[10]
  12. On Memory, set Memory to 2048, then click Next.[10]
  13. On Network, keep the defaults; configure a static IP from the router if needed, then click Next.[10]
  14. On DNS, keep the defaults and click Next.[10]
  15. Review the summary and click Finish.[10]
  16. When creation completes, close the download dialog if it remains open.[10]
  17. Right-click the Docker LXC in the left navigation and choose Start.[10]
  18. Click Console in the sub-navigation.[10]

Enter the CT password during creation; use a unique password and do not store it in a file or script.[10]

2. Update the container and leave the TurnKey menus

  1. Log into the container as root with the password set earlier.[10]
  2. In Initialize Hub services, press Tab, select Skip, and press Enter.[10]
  3. In System Notifications, press Tab, select Skip, and press Enter.[10]
  4. In Security updates, press Tab to choose Install for automatic updates or Skip, then press Enter.[10]
  5. Press Enter to select Advanced Menu.[10]
  6. Arrow down to Quit, press Enter, select Yes, and press Enter.[10]
  7. Run the update commands:[10]
1
2
3
4
5
6
7
8
# update software repositories
apt update
# install available software updates
apt upgrade -y
# clean apt cache
apt clean
# reboot the container
reboot now
  1. Log back into the container after the reboot.[10]

3. Install Docker

  1. Run the tutorial's package and repository sequence.[10]
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# install prerequisites
apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common -y
# add docker gpg key
curl -fsSL https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release)/gpg | apt-key add -
# add docker apt repository
add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release) $(lsb_release -cs) stable"
# update software repositories
apt update
# install docker
apt install docker-ce docker-compose containerd.io -y
  1. Confirm that the Docker host is ready for docker run and docker-compose from the terminal.[10]
  2. Continue by running Docker containers from the terminal as needed.[10]

4. Optional Portainer

  1. Create Portainer's data directory and run the container; Portainer provides a web UI for container management.[10]
1
2
3
4
5
6
# create a working directory for portainer
mkdir ~/docker/portainer_data -p
# run the portainer container
docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v ~/docker/portainer_data:/data portainer/portainer-ce
# output the ip docker host address
ip addr

Then:[10]

  1. Open http://DNSorIP:9000.[10]
  2. Create the administrator username and password in the local UI, then click Create user.[10]
  3. Choose Docker - Manage the local Docker environment, then click Connect.[10]
  4. Confirm that Portainer displays the Docker environment.[10]

Checks and limits

I inspect docker ps, run a test container, review logs, and confirm the Portainer volume exists. Docker inside LXC must be evaluated against the current Proxmox version, privileged/unprivileged mode, and kernel policy; the source tutorial does not guarantee the same defaults on every newer host. I do not expose Portainer directly to the Internet or put real credentials in an image/script.[10]

Original tutorial video: [watch it on YouTube]1.[15]

Source

Original source: [Running A Docker Host in a Proxmox VE LXC Linux Container [CT]]2, published/updated 2021-10-01.[10]

Sources

[10] https://i12bretro.github.io/tutorials/0595.html — Running a Docker Host in a Proxmox VE LXC Linux Container [15] https://www.youtube.com/watch?v=q98XUBf2YO4 — Running A Docker Host in a Proxmox VE LXC Linux Container (CT) — i12bretro video


  1. https://www.youtube.com/watch?v=q98XUBf2YO4 — official i12bretro video. ↩︎

  2. https://i12bretro.github.io/tutorials/0595.html — Running A Docker Host in a Proxmox VE LXC Linux Container [CT]. ↩︎


0 Bình luận

Góp Ý / Bình Luận / Đánh giá