Jan Wagner revised this gist 2 years ago. Go to revision
1 file changed, 1 insertion, 1 deletion
docker_deploy.sh
| @@ -1,7 +1,7 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | 2 | # detect release and add package sources | |
| 3 | 3 | #[ "$(lsb_release -rs)" = "testing" ] || [ "$(cat /etc/debian_version | awk -F. {'print $1'})" -ne "8" ] && echo exit 1 | |
| 4 | - | echo "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" > \ | |
| 4 | + | echo "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/debian $(lsb_release -cs) stable" > \ | |
| 5 | 5 | /etc/apt/sources.list.d/$(lsb_release -cs)-docker.list && \ | |
| 6 | 6 | # Install needed dependencies | |
| 7 | 7 | apt-get install -y apt-transport-https ca-certificates bridge-utils curl sudo && \ | |
Jan Wagner revised this gist 2 years ago. Go to revision
1 file changed, 1 insertion, 1 deletion
docker_deploy.sh
| @@ -1,6 +1,6 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | 2 | # detect release and add package sources | |
| 3 | - | [ "$(lsb_release -rs)" = "testing" ] || [ "$(cat /etc/debian_version | awk -F. {'print $1'})" -ne "8" ] && echo exit 1 | |
| 3 | + | #[ "$(lsb_release -rs)" = "testing" ] || [ "$(cat /etc/debian_version | awk -F. {'print $1'})" -ne "8" ] && echo exit 1 | |
| 4 | 4 | echo "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" > \ | |
| 5 | 5 | /etc/apt/sources.list.d/$(lsb_release -cs)-docker.list && \ | |
| 6 | 6 | # Install needed dependencies | |
Jan Wagner revised this gist 2 years ago. Go to revision
1 file changed, 1 insertion, 1 deletion
autoupgrade_docker-ce_container.io.sh
| @@ -1,7 +1,7 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | 2 | cat <<EOF > /etc/apt/preferences.d/docker_pinning | |
| 3 | 3 | Package: docker-ce* | |
| 4 | - | Pin: version 5:23.0* | |
| 4 | + | Pin: version 5:24.0* | |
| 5 | 5 | Pin-Priority: 1000 | |
| 6 | 6 | ||
| 7 | 7 | Package: containerd.io | |
Jan Wagner revised this gist 2 years ago. Go to revision
1 file changed, 1 insertion, 1 deletion
deploy_addons.sh
| @@ -16,7 +16,7 @@ if [ ! -L /usr/local/bin/docker-compose ]; then | |||
| 16 | 16 | [ -f /usr/local/bin/docker-compose-v1 ] && update-alternatives --install /usr/local/bin/docker-compose docker-compose /usr/local/bin/docker-compose-v1 | |
| 17 | 17 | fi; | |
| 18 | 18 | # Install ctop | |
| 19 | - | echo "deb http://packages.azlux.fr/debian/ buster main" | tee /etc/apt/sources.list.d/azlux.list && \ | |
| 19 | + | echo "deb http://packages.azlux.fr/debian/ $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/azlux.list && \ | |
| 20 | 20 | if [ -d /etc/apt/trusted.gpg.d/ ]; then curl -fsSL https://azlux.fr/repo.gpg.key | sudo gpg --batch --yes --dearmor -o /etc/apt/trusted.gpg.d/azlux.gpg; else curl -fsSL https://azlux.fr/repo.gpg.key | sudo apt-key add -; fi && \ | |
| 21 | 21 | apt update && \ | |
| 22 | 22 | apt install docker-ctop && \ | |
Jan Wagner revised this gist 2 years ago. Go to revision
1 file changed, 1 insertion, 1 deletion
autoupgrade_docker-ce_container.io.sh
| @@ -16,5 +16,5 @@ Package: docker-ce* | |||
| 16 | 16 | Pin: release o=Docker | |
| 17 | 17 | Pin-Priority: -1 | |
| 18 | 18 | EOF | |
| 19 | - | [ ! $(grep -c "label=Docker CE" /etc/apt/apt.conf.d/50unattended-upgrades) -gt 0 ] && \ | |
| 19 | + | [ -f /etc/apt/apt.conf.d/50unattended-upgrades ] && [ ! $(grep -c "label=Docker CE" /etc/apt/apt.conf.d/50unattended-upgrades) -gt 0 ] && \ | |
| 20 | 20 | sed -i '/-security,label=Debian-Security/a\ "origin=Docker,archive=${distro_codename},label=Docker CE";' /etc/apt/apt.conf.d/50unattended-upgrades || exit 0 | |
Jan Wagner revised this gist 2 years ago. Go to revision
1 file changed, 1 insertion, 1 deletion
deploy_addons.sh
| @@ -28,6 +28,6 @@ LAZYDOCKER_VERSION=$(curl -L -s -H 'Accept: application/json' https://github.com | |||
| 28 | 28 | GITHUB_FILE="lazydocker_${LAZYDOCKER_VERSION//v/}_$(uname -s)_$(uname -m).tar.gz" && \ | |
| 29 | 29 | GITHUB_URL="https://github.com/jesseduffield/lazydocker/releases/download/${LAZYDOCKER_VERSION}/${GITHUB_FILE}" && \ | |
| 30 | 30 | curl -so ${TMPDIR}/lazydocker.tar.gz -L ${GITHUB_URL} && \ | |
| 31 | - | tar xzvf ${TMPDIR}/lazydocker.tar.gz -C ${TMPDIR} && \ | |
| 31 | + | tar xzf ${TMPDIR}/lazydocker.tar.gz -C ${TMPDIR} && \ | |
| 32 | 32 | mv -f ${TMPDIR}/lazydocker /usr/local/bin/ && \ | |
| 33 | 33 | [ -f /usr/local/bin/ctop ] && rm -rf /usr/local/bin/ctop || exit 0 \ | |
Jan Wagner revised this gist 2 years ago. Go to revision
1 file changed, 9 insertions, 2 deletions
deploy_addons.sh
| @@ -20,7 +20,14 @@ echo "deb http://packages.azlux.fr/debian/ buster main" | tee /etc/apt/sources.l | |||
| 20 | 20 | if [ -d /etc/apt/trusted.gpg.d/ ]; then curl -fsSL https://azlux.fr/repo.gpg.key | sudo gpg --batch --yes --dearmor -o /etc/apt/trusted.gpg.d/azlux.gpg; else curl -fsSL https://azlux.fr/repo.gpg.key | sudo apt-key add -; fi && \ | |
| 21 | 21 | apt update && \ | |
| 22 | 22 | apt install docker-ctop && \ | |
| 23 | + | # Creating some temp dir | |
| 24 | + | TMPDIR=$(mktemp -d /tmp/d.XXXXXX) && \ | |
| 25 | + | trap 'rm -rf "${TMPDIR}"' EXIT && \ | |
| 23 | 26 | # Install lazydocker | |
| 24 | - | curl -so /tmp/deploy_lazydocker.sh https://gist.githubusercontent.com/waja/be393038c754cff65d58850c1131d938/raw/deploy_lazydocker.sh && \ | |
| 25 | - | bash /tmp/deploy_lazydocker.sh && \ | |
| 27 | + | LAZYDOCKER_VERSION=$(curl -L -s -H 'Accept: application/json' https://github.com/jesseduffield/lazydocker/releases/latest | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/') && \ | |
| 28 | + | GITHUB_FILE="lazydocker_${LAZYDOCKER_VERSION//v/}_$(uname -s)_$(uname -m).tar.gz" && \ | |
| 29 | + | GITHUB_URL="https://github.com/jesseduffield/lazydocker/releases/download/${LAZYDOCKER_VERSION}/${GITHUB_FILE}" && \ | |
| 30 | + | curl -so ${TMPDIR}/lazydocker.tar.gz -L ${GITHUB_URL} && \ | |
| 31 | + | tar xzvf ${TMPDIR}/lazydocker.tar.gz -C ${TMPDIR} && \ | |
| 32 | + | mv -f ${TMPDIR}/lazydocker /usr/local/bin/ && \ | |
| 26 | 33 | [ -f /usr/local/bin/ctop ] && rm -rf /usr/local/bin/ctop || exit 0 \ | |
Jan Wagner revised this gist 2 years ago. Go to revision
1 file changed, 3 insertions, 3 deletions
docker_deploy.sh
| @@ -9,7 +9,7 @@ echo "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -c | |||
| 9 | 9 | apt-get update; \ | |
| 10 | 10 | # Deploy pinning and unatteded upgrade config for docker-ce and container.io | |
| 11 | 11 | # yes, we can do 'curl pipe bash', but this way we can adjust the script if something failes without redownload it | |
| 12 | - | curl -o /tmp/autoupgrade_docker-ce_container.io.sh https://gist.githubusercontent.com/waja/01ba2641f93f461044f9/raw/autoupgrade_docker-ce_container.io.sh && \ | |
| 12 | + | curl -so /tmp/autoupgrade_docker-ce_container.io.sh https://gist.githubusercontent.com/waja/01ba2641f93f461044f9/raw/autoupgrade_docker-ce_container.io.sh && \ | |
| 13 | 13 | bash /tmp/autoupgrade_docker-ce_container.io.sh && \ | |
| 14 | 14 | # Install docker and enable it | |
| 15 | 15 | apt-get install -y docker-ce && \ | |
| @@ -29,7 +29,7 @@ cat > /etc/docker/daemon.json <<EOF | |||
| 29 | 29 | } | |
| 30 | 30 | EOF | |
| 31 | 31 | # Install docker-compose and ctop | |
| 32 | - | curl -o /tmp/deploy_addons.sh https://gist.githubusercontent.com/waja/01ba2641f93f461044f9/raw/deploy_addons.sh && \ | |
| 32 | + | curl -so /tmp/deploy_addons.sh https://gist.githubusercontent.com/waja/01ba2641f93f461044f9/raw/deploy_addons.sh && \ | |
| 33 | 33 | bash /tmp/deploy_addons.sh && \ | |
| 34 | 34 | # Blacklist container.io for needsrestart | |
| 35 | 35 | [ -d /etc/needrestart/conf.d/ -a ! -f /etc/needrestart/conf.d/blacklist_rc.conf ] && \ | |
| @@ -58,4 +58,4 @@ docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /etc:/etc:ro -e | |||
| 58 | 58 | EOF | |
| 59 | 59 | chmod +x /etc/cron.weekly/docker-cleanup | |
| 60 | 60 | # To update pinning, unattended upgrade config and updating docker compose, ctop and lazydocker | |
| 61 | - | # curl -o /tmp/autoupgrade_docker-ce_container.io.sh https://gist.githubusercontent.com/waja/01ba2641f93f461044f9/raw/autoupgrade_docker-ce_container.io.sh && bash /tmp/autoupgrade_docker-ce_container.io.sh && curl -o /tmp/deploy_addons.sh https://gist.githubusercontent.com/waja/01ba2641f93f461044f9/raw/deploy_addons.sh && bash /tmp/deploy_addons.sh | |
| 61 | + | # curl -so /tmp/autoupgrade_docker-ce_container.io.sh https://gist.githubusercontent.com/waja/01ba2641f93f461044f9/raw/autoupgrade_docker-ce_container.io.sh && bash /tmp/autoupgrade_docker-ce_container.io.sh && curl -so /tmp/deploy_addons.sh https://gist.githubusercontent.com/waja/01ba2641f93f461044f9/raw/deploy_addons.sh && bash /tmp/deploy_addons.sh | |
Jan Wagner revised this gist 2 years ago. Go to revision
1 file changed, 1 insertion, 1 deletion
deploy_addons.sh
| @@ -17,7 +17,7 @@ if [ ! -L /usr/local/bin/docker-compose ]; then | |||
| 17 | 17 | fi; | |
| 18 | 18 | # Install ctop | |
| 19 | 19 | echo "deb http://packages.azlux.fr/debian/ buster main" | tee /etc/apt/sources.list.d/azlux.list && \ | |
| 20 | - | if [ -d /etc/apt/trusted.gpg.d/ ]; then curl -fsSL https://azlux.fr/repo.gpg.key | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/azlux.gpg; else curl -fsSL https://azlux.fr/repo.gpg.key | sudo apt-key add -; fi && \ | |
| 20 | + | if [ -d /etc/apt/trusted.gpg.d/ ]; then curl -fsSL https://azlux.fr/repo.gpg.key | sudo gpg --batch --yes --dearmor -o /etc/apt/trusted.gpg.d/azlux.gpg; else curl -fsSL https://azlux.fr/repo.gpg.key | sudo apt-key add -; fi && \ | |
| 21 | 21 | apt update && \ | |
| 22 | 22 | apt install docker-ctop && \ | |
| 23 | 23 | # Install lazydocker | |
Jan Wagner revised this gist 2 years ago. Go to revision
1 file changed, 1 insertion, 1 deletion
autoupgrade_docker-ce_container.io.sh
| @@ -17,4 +17,4 @@ Pin: release o=Docker | |||
| 17 | 17 | Pin-Priority: -1 | |
| 18 | 18 | EOF | |
| 19 | 19 | [ ! $(grep -c "label=Docker CE" /etc/apt/apt.conf.d/50unattended-upgrades) -gt 0 ] && \ | |
| 20 | - | sed -i '/-security,label=Debian-Security/a\ "origin=Docker,archive=${distro_codename},label=Docker CE";' /etc/apt/apt.conf.d/50unattended-upgrades | |
| 20 | + | sed -i '/-security,label=Debian-Security/a\ "origin=Docker,archive=${distro_codename},label=Docker CE";' /etc/apt/apt.conf.d/50unattended-upgrades || exit 0 | |