Skip to content

Instantly share code, notes, and snippets.

@barryvdh
Created May 18, 2021 14:06
Show Gist options
  • Save barryvdh/5c97a71559e5b0d24a708f6eff6eebcc to your computer and use it in GitHub Desktop.
Save barryvdh/5c97a71559e5b0d24a708f6eff6eebcc to your computer and use it in GitHub Desktop.

Revisions

  1. barryvdh created this gist May 18, 2021.
    25 changes: 25 additions & 0 deletions install_docker
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    echo ">> Follow install based on https://docs.docker.com/engine/install/ubuntu/"
    echo ">> Update the apt package index and install packages to allow apt to use a repository over HTTPS:"
    apt-get update

    apt-get -y install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg \
    lsb-release

    echo ">> Add Docker’s official GPG key:"
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

    echo "Use the following command to set up the stable repository:"
    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

    echo "Update the apt package index, and install the latest version of Docker Engine and containerd, or go to the next step to install a specific version:"
    apt-get update
    apt-get -y install docker-ce docker-ce-cli containerd.io

    echo "Verify that Docker Engine is installed correctly by running the hello-world image."
    docker run hello-world