Last active
January 17, 2025 15:38
-
-
Save ScottJWalter/7a8dc06c812a952d3a5f9884b76be9fd to your computer and use it in GitHub Desktop.
Install docker into Ubuntu instance (based on docs.docker.com)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # update apt repos | |
| sudo apt-get update | |
| # install curl and keyring (certificate) support | |
| sudo apt-get install -y \ | |
| ca-certificates \ | |
| curl \ | |
| python3-pip \ | |
| python-is-python3 | |
| sudo install -m 0755 -d /etc/apt/keyrings | |
| # Add Docker's official GPG key: | |
| 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 | |
| # install docker (et al) | |
| sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | |
| # verify | |
| sudo docker run hello-world |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just a simple shell script that installs docker and its dependencies on Ubuntu. Taken from the docker documentation. I threw this together to remember how to spin up Multipass VMs.
curlwget