Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This small Bash script will install the latest version of Docker on your Raspberry pi - It works on Raspberry Pi 4 B+ - Just run --> curl -fsSL http://bit.ly/2xm7kxb | sh
#!/bin/bash
##################################################
#- version ${SCRIPT_NAME} 0.0.1
#- author Marcos Soutullo
#- license GNU General Public License
# DESCRIPTION
# This small bash script will install Docker on your RaspberryPi for you without human interaction.
# If your Raspbian version it's not currently available on get.docker.com
# It will download use the latest Debian stable version defined in variable DOCKER_STABLE
# EXECUTION
# curl -fsSL http://bit.ly/2xm7kxb | sudo sh
# WARNING
# If you already have Docker installed, this script can cause trouble.
# If you installed the current Docker package using this script and are using it
# again to update Docker, you can safely ignore this message.
##################################################
DOCKER_STABLE='18.09.7~3-0~debian-buster_armhf.deb'
CONTAINERD_STABLE='1.2.6-3_armhf.deb'
# Ensuring our system packages are up to date
apt update && apt upgrade -y
# Install packages to allow apt to use repository over HTTPs - Plus other useful stuff
apt install apt-transport-https ca-certificates software-properties-common git wget pparmor-utils avahi-daemon curl dbus jq network-manager socat
# Install Docker -
curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh || {
echo "It seems that your distribution is not available yet We're going to install compiled images on docker-${DOCKER_STABLE} \
and containerd-${CONTAINERD_STABLE}"
wget https://download.docker.com/linux/debian/dists/buster/pool/stable/armhf/containerd.io_$CONTAINERD_STABLE
wget https://download.docker.com/linux/debian/dists/buster/pool/stable/armhf/docker-ce-cli_$DOCKER_STABLE
wget https://download.docker.com/linux/debian/dists/buster/pool/stable/armhf/docker-ce_$DOCKER_STABLE
dpkg -i containerd.io_$CONTAINERD_STABLE
dpkg -i docker-ce-cli_$DOCKER_STABLE
dpkg -i docker-ce_$DOCKER_STABLE }
usermod -aG docker ${USER} && su - ${USER}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.