You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

17 lines
577 B

#!/bin/bash
if ! type -p docker; then
echo "Installing docker..."
curl -sSL https://get.docker.io | sh
fi
version="$(apt-cache madison docker-ce | cut -f 2 -d \| | grep 17.06 | head -n 1 | xargs echo)"
## DOWNGRADE to 17.xx because 18.xx do not support registry v1
apt-get install -y --force-yes docker-ce="$version"
if ! egrep 'disable-legacy-registry' /lib/systemd/system/docker.service 2>/dev/null; then
sed -ri 's/^(ExecStart=.*)$/\1 --disable-legacy-registry=false/g' /lib/systemd/system/docker.service
fi
systemctl daemon-reload &&
service docker restart