From a8482f224b6e7cfa8402b471978aac7ea76d92c4 Mon Sep 17 00:00:00 2001 From: Michael Chiou Date: Thu, 16 May 2024 11:21:27 -0700 Subject: [PATCH] #7944: Add docker convenience installation script for devs --- scripts/docker/install_docker.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 scripts/docker/install_docker.sh diff --git a/scripts/docker/install_docker.sh b/scripts/docker/install_docker.sh new file mode 100755 index 00000000000..76ad1d60786 --- /dev/null +++ b/scripts/docker/install_docker.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# Setup sources for docker +sudo apt-get update -y +sudo apt-get install ca-certificates curl +sudo install -m 0755 -d /etc/apt/keyrings +sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc +sudo chmod a+r /etc/apt/keyrings/docker.asc + +# Add the repository to Apt sources: +echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ + $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ + sudo tee /etc/apt/sources.list.d/docker.list > /dev/null +sudo apt-get update -y + +# Install docker and plugins +sudo apt-get install -y \ + docker-ce=5:26.1.1-1~ubuntu.20.04~focal \ + docker-ce-cli=5:26.1.1-1~ubuntu.20.04~focal \ + containerd.io=1.6.31-1 \ + docker-buildx-plugin=0.14.0-1~ubuntu.20.04~focal \ + docker-compose-plugin=2.27.0-1~ubuntu.20.04~focal + +# Set up docker for non-root user +sudo groupadd docker +sudo usermod -aG docker $USER +newgrp docker