Skip to content

Instantly share code, notes, and snippets.

@MeenachiSundaram
Last active December 29, 2023 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save MeenachiSundaram/6ffbbe38a072b94ad8d695d49d977ef7 to your computer and use it in GitHub Desktop.
Save MeenachiSundaram/6ffbbe38a072b94ad8d695d49d977ef7 to your computer and use it in GitHub Desktop.
startup script for installing docker in GCP
#!/bin/bash
apt-get update
apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
apt-get update
apt-get install -y docker-ce
@MeenachiSundaram
Copy link
Author

After installation of docker add user

sudo groupadd docker
sudo usermod -aG docker $USER
  • Restart the VM
  • Try running test container docker run hello-world

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment