upgrade to docker 20.10.12
This commit is contained in:
parent
03a8dba327
commit
ef68403cc8
|
|
@ -1,8 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
|
|
||||||
# NB execute apt-cache madison docker-ce to known the available versions.
|
docker_version="${1:-20.10.12}"; shift || true
|
||||||
docker_version="${1:-5:20.10.6~3-0~ubuntu-focal}"; shift || true
|
|
||||||
registry_proxy_domain="${1:-$(hostname --fqdn)}"; shift || true
|
registry_proxy_domain="${1:-$(hostname --fqdn)}"; shift || true
|
||||||
# NB as-of docker 19.03.8, there is still no way to specify a registry mirror credentials,
|
# NB as-of docker 19.03.8, there is still no way to specify a registry mirror credentials,
|
||||||
# as such, we cannot use our docker-group registry, instead we must use the docker-proxy
|
# as such, we cannot use our docker-group registry, instead we must use the docker-proxy
|
||||||
|
|
@ -16,16 +15,22 @@ registry_proxy_url="https://$registry_proxy_host"
|
||||||
# dpkg-preconfigure: unable to re-open stdin: No such file or directory
|
# dpkg-preconfigure: unable to re-open stdin: No such file or directory
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
# make sure the package index cache is up-to-date before installing anything.
|
||||||
|
apt-get update
|
||||||
|
|
||||||
# install docker.
|
# install docker.
|
||||||
# see https://docs.docker.com/install/linux/docker-ce/ubuntu/
|
# see https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#install-using-the-repository
|
||||||
apt-get install -y apt-transport-https software-properties-common gnupg2
|
apt-get install -y apt-transport-https software-properties-common
|
||||||
wget -qO- https://download.docker.com/linux/ubuntu/gpg | apt-key add -
|
wget -qO- https://download.docker.com/linux/ubuntu/gpg | apt-key add -
|
||||||
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
|
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
|
||||||
apt-get update
|
apt-get update
|
||||||
|
apt-cache madison docker-ce
|
||||||
|
docker_version="$(apt-cache madison docker-ce | awk "/$docker_version~/{print \$3}")"
|
||||||
apt-get install -y "docker-ce=$docker_version" "docker-ce-cli=$docker_version" containerd.io
|
apt-get install -y "docker-ce=$docker_version" "docker-ce-cli=$docker_version" containerd.io
|
||||||
|
|
||||||
# configure it.
|
# configure it.
|
||||||
cat >/etc/docker/daemon.json <<EOF
|
systemctl stop docker
|
||||||
|
cat >/etc/docker/daemon.json <<'EOF'
|
||||||
{
|
{
|
||||||
"experimental": false,
|
"experimental": false,
|
||||||
"debug": false,
|
"debug": false,
|
||||||
|
|
@ -48,7 +53,7 @@ ExecStart=
|
||||||
ExecStart=/usr/bin/dockerd
|
ExecStart=/usr/bin/dockerd
|
||||||
EOF
|
EOF
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl restart docker
|
systemctl start docker
|
||||||
|
|
||||||
# let the vagrant user manage docker.
|
# let the vagrant user manage docker.
|
||||||
usermod -aG docker vagrant
|
usermod -aG docker vagrant
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue