k8x/systemd/install_docker.sh

34 lines
1 KiB
Bash
Raw Normal View History

2024-05-17 21:45:52 -04:00
#!/bin/bash
echo ""
echo "... ] INSTALLING DOCKER [ ..."
HOME=$( cd "$(dirname "$0")" && pwd )
source $HOME/../config
# remove lxcfs, as we don't need it if we're doing docker
service lxcfs stop
apt-get remove -y -q lxc-common lxcfs lxd lxd-client
#setup docker from the official repo
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
DEBIANVER=`lsb_release -cs`
cat <<EOF > /etc/apt/sources.list.d/docker.list
deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") ${DEBIANVER} stable nightly
EOF
apt-mark unhold containerd.io
apt-mark unhold docker-ce
apt-mark unhold docker-ce-cli
apt-get update
apt-get install --allow-downgrades -y containerd.io=1.4.1-1 docker-ce=5:19.03.13~3-0~debian-${DEBIANVER} docker-ce-cli=5:19.03.13~3-0~debian-${DEBIANVER}
systemctl enable docker
systemctl start docker
#prevents auto updating of docker package
apt-mark hold containerd.io
apt-mark hold docker-ce
apt-mark hold docker-ce-cli