Skip to content

Instantly share code, notes, and snippets.

@TyIsI
Last active August 22, 2023 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TyIsI/a5fe8052584f06e1d6d056380d689949 to your computer and use it in GitHub Desktop.
Save TyIsI/a5fe8052584f06e1d6d056380d689949 to your computer and use it in GitHub Desktop.
Install script to install Docker and Docker Compose based on the instructions from the website
#!/bin/sh
echo "Running initial update..." \
&& sudo apt update \
&& echo "Running system upgrades..." \
&& sudo apt upgrade -y \
&& echo "Installing dependencies..." \
&& sudo apt install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common \
&& echo "Installing docker package keys" \
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - \
&& echo "Verify the finger print:" \
&& sudo apt-key fingerprint 0EBFCD88 \
&& echo "Adding docker repository..." \
&& sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable" \
&& echo "Updating..." \
&& sudo apt update \
&& echo "Installing Docker..." \
&& sudo apt install -y docker-ce docker-ce-cli containerd.io docker-ce-rootless-extras docker-buildx-plugin docker-compose-plugin \
&& echo "Verifying install" \
&& sudo docker run hello-world \
&& echo "Installing docker-gc..." \
&& sudo curl -L "https://gist.github.com/TyIsI/1aeb2981ceebd8f8d2203755c00d1c82/raw/5a953000da1e7e1c6a1e21d08598baa529fd1e14/docker-gc" -o /usr/local/bin/docker-gc \
&& sudo chmod 755 /usr/local/bin/docker-gc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment