Install Docker for Ubuntu

In this step, we will proceed to install Docker for our Lightsail Instance to build the container image. You can refer to the installation process here

  1. Run the following command to install the necessary packages and add the GPG ( GNU Privacy Guard ) key to be able to use the Docker repository.
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Lightsail

  1. Run below command to add Docker Repo.
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Lightsail

  1. Install Docker from Repo by running the command below
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io -y

Lightsail

  1. Check the Docker installation with the command below.
sudo docker run hello-world

Lightsail

  1. The next step we will proceed to build the container image to deploy.

Lightsail