Instalando los paquetes básicos
apt-get update
apt-get install -y ca-certificates curl gnupg
Adicionando las llaves
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://repos.uclv.edu.cu/docker-ce/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg
Adicionando los repositorios
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://repos.uclv.edu.cu/docker-ce/linux/debian \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null
Actualizando
apt-get update
Instalar última version de docker:
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
O instalar alguna específica:
apt-cache madison docker-ce | awk '{ print $3 }'
5:24.0.0-1~debian.11~bullseye
5:23.0.6-1~debian.11~bullseye
<...>
VERSION_STRING=5:24.0.0-1~debian.11~bullseye
apt-get install docker-ce=$VERSION_STRING docker-ce-cli=$VERSION_STRING containerd.io docker-buildx-plugin docker-compose-plugin
Probar
docker run docker.uclv.cu/hello-world
Adaptado desde: https://docs.docker.com/engine/install/debian/