A guide for anyone to start their own Docker tutorial
- Google Cloud Account
- Personal/work computer
Create your Google Cloud Account
- Click on above link
- Get through payment to free trial (if you haven't used google cloud)
- Enable billing (you won't be charged if within your trial window)
- Deploy the VM
- Arrive at Google Cloud Console
- In top search bar type
Ubuntu focal
and select the result - Click
Launch
- Change Firewall and Region options
- Select a region close to you
- Allow HTTP and HTTPS Traffic (if you choose to keep this environment change this to HTTPS only after this tutorial)
- Click
Create
at the bottom of the page- You will land on the
VM Instances
page
- You will land on the
- Select
Connect -> Open in Browser Window
to open SSH session
- Copy down the
External IP
field
- Note: This IP will likely change when instance is powered off/on
Install Docker CE
- Uninstall old versions
$ sudo apt-get remove docker docker-engine docker.io containerd runc
- Update 'apt' package index
$ sudo apt-get update
- Install packages to allow apt to use a repository over HTTPS
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
- Add Docker's Official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- Verify key fingerprint [9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88]
$ sudo apt-key fingerprint 0EBFCD88
- Perform architecture specific install (x86-64 below, others in source document, link in docker header)
- NOTE: 'bionic' is a temporary fix until 20.04 is supported by Docker, check install link before running!
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
bionic \
stable"
- Use
uname -m
to determine your architecture
- Install Docker CE
$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io
- Enable docker on startup
$ sudo systemctl enable docker
Deploy your first container!
- From SSH Terminal
- type and enter
$ sudo docker run -dp 80:80 dockersamples/101-tutorial
- Open your web browser and go to
http://<your external ip>