From 9f865a52408dc4a3100a0432ee802c1f5468b33d Mon Sep 17 00:00:00 2001 From: Nicolas Dorier Date: Wed, 22 Nov 2023 12:46:45 +0900 Subject: [PATCH] Update docker version during btcpay-update (#847) --- helpers.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/helpers.sh b/helpers.sh index 4eee80e..11a5f47 100755 --- a/helpers.sh +++ b/helpers.sh @@ -144,6 +144,30 @@ docker_update() { apt install libseccomp2 -t buster-backports fi fi + + # Can't run with docker-ce before 20.10.10... check against version 21 instead, easier to compare + if [ "21" \> "$(docker version -f "{{ .Server.Version }}")" ]; then + echo "Updating docker, old version can't run some images (https://docs.linuxserver.io/FAQ/#jammy)" + echo \ + "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ + "$(lsb_release -cs)" stable" | \ + tee /etc/apt/sources.list.d/docker.list > /dev/null + + apt-get update + apt-get upgrade -y docker-ce docker-ce-cli containerd.io + + # Possible that old distro like xenial doesn't have it anymore, if so, just take + # the next distrib + if [ "21" \> "$(docker version -f "{{ .Server.Version }}")" ]; then + echo "Updating docker, with bionic's version" + echo \ + "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ + bionic stable" | \ + tee /etc/apt/sources.list.d/docker.list > /dev/null + apt-get update + apt-get upgrade -y docker-ce docker-ce-cli containerd.io + fi + fi } btcpay_up() {