Skip to content

Commit 6203f29

Browse files
committed
feat: upgrade Docker installation to use official Docker repository
- Remove ubuntu docker.io package from apt packages list - Add official Docker GPG key and repository setup - Install docker-ce, docker-ce-cli, containerd.io, docker-buildx-plugin, docker-compose-plugin - Remove manual Docker Compose v2.21.0 installation - Add Docker version verification steps - Update project-words.txt with new technical terms (buildx, containerd, dpkg, keyrings) This ensures we get the latest Docker version (28.3.1) and Docker Compose v2.38.1 as per the official Docker installation documentation.
1 parent 22ee5f3 commit 6203f29

File tree

2 files changed

+30
-11
lines changed

2 files changed

+30
-11
lines changed

infrastructure/cloud-init/user-data.yaml.tpl

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ packages:
5252
- ufw
5353
- fail2ban
5454
- unattended-upgrades
55-
- docker.io
5655
# Torrust Tracker dependencies for future source compilation
5756
# Currently using Docker, but planning to compile from source for better performance
5857
- pkg-config
@@ -119,21 +118,37 @@ runcmd:
119118
- systemctl restart sshd
120119
- systemctl enable ssh
121120

121+
# Install Docker using official method
122+
# Remove any old Docker packages
123+
- >
124+
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do
125+
apt-get remove -y $pkg || true; done
126+
127+
# Add Docker's official GPG key
128+
- mkdir -p /etc/apt/keyrings
129+
- >
130+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg
131+
-o /etc/apt/keyrings/docker.asc
132+
- chmod a+r /etc/apt/keyrings/docker.asc
133+
# Add Docker repository
134+
- >
135+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu
136+
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
137+
138+
# Update package index and install Docker
139+
- apt-get update
140+
- >
141+
apt-get install -y docker-ce docker-ce-cli containerd.io
142+
docker-buildx-plugin docker-compose-plugin
143+
122144
# Configure Docker
123145
- systemctl enable docker
124146
- systemctl start docker
125147
- usermod -aG docker torrust
126148

127-
# Install Docker Compose V2 plugin (compatible with compose.yaml format)
128-
- mkdir -p /usr/local/lib/docker/cli-plugins
129-
- >
130-
curl -SL
131-
"https://github.com/docker/compose/releases/download/v2.21.0/docker-compose-linux-x86_64"
132-
-o /usr/local/lib/docker/cli-plugins/docker-compose
133-
- chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
134-
- >
135-
ln -sf /usr/local/lib/docker/cli-plugins/docker-compose
136-
/usr/local/bin/docker-compose
149+
# Verify Docker installation
150+
- docker --version
151+
- docker compose version
137152

138153
# CRITICAL: Configure UFW firewall SAFELY (allow SSH BEFORE enabling)
139154
- ufw --force reset

project-words.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ AECDH
22
AESGCM
33
autoport
44
bantime
5+
buildx
56
cdrom
67
certbot
78
cloudinit
89
commoninit
10+
containerd
911
CPUS
1012
dialout
1113
direnv
@@ -14,6 +16,7 @@ dnsmasq
1416
domifaddr
1517
dominfo
1618
domstate
19+
dpkg
1720
dsmode
1821
ECDH
1922
ehthumbs
@@ -26,6 +29,7 @@ fullchain
2629
genisoimage
2730
hetznercloud
2831
journalctl
32+
keyrings
2933
letsencrypt
3034
libsqlite
3135
libvirtd

0 commit comments

Comments
 (0)