How Do You Install Docker on Debian 9 in GCP?

Problem scenario
You are running Debian 9 in GCP.  You want to install Docker on this server.  What should you do?

Solution
1.  Create a script in /tmp/ call installer.sh with the following lines of content:

#!/bin/bash
apt-get -y update
apt-get install -y apt-transport-https ca-certificates wget software-properties-common
wget https://download.docker.com/linux/debian/gpg
apt-key add gpg
echo "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee -a /etc/apt/sources.list.d/docker.list
apt-get -y update
apt-cache policy docker-ce
apt-get -y install docker-ce

2.  Run this command:  sudo bash /tmp/installer.sh

Leave a comment

Your email address will not be published. Required fields are marked *