Skip to content

Instantly share code, notes, and snippets.

@pgandla
Last active January 25, 2025 00:02
Show Gist options
  • Select an option

  • Save pgandla/3750c0dc5f1c7502e6829f2396172641 to your computer and use it in GitHub Desktop.

Select an option

Save pgandla/3750c0dc5f1c7502e6829f2396172641 to your computer and use it in GitHub Desktop.
Linux-setups

Update package list and install prerequisites

sudo apt-get update

sudo apt-get install -y \

    unzip \

    curl

Download the AWS CLI v2 installer

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"

Unzip the installer

unzip awscliv2.zip

Run the install script

sudo ./aws/install

Clean up downloaded files

rm awscliv2.zip

rm -rf aws/

Verify the installation

aws --version

Install amazon-ecr-credential-helper

sudo apt update -y

sudo apt install amazon-ecr-credential-helper

mkdir -p /home/ubuntu/.docker

touch config

{
  "credHelpers": {
    "123456789012.dkr.ecr.eu-west-2.amazonaws.com": "ecr-login"
  }
}****

Docker restart

sudo systemctl restart docker


Update package list

sudo apt update

Install prerequisites for Docker

sudo apt install -y \
    apt-transport-https \
    ca-certificates \
    curl \
    software-properties-common \
    gnupg

Add Docker's official GPG key

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

Add Docker repository

echo \
    "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" |
    sudo tee /etc/apt/sources.list.d/docker.list >/dev/null

Update package list again

sudo apt update

Install Docker CE

sudo apt install -y \
    docker-ce \
    docker-ce-cli \
    containerd.io \
    docker-buildx-plugin \
    docker-compose-plugin

Add your user to docker group (to run docker without sudo)

sudo usermod -aG docker $USER
newgrp docker

Start and enable services

sudo systemctl start **docker**
sudo systemctl enable docker

Verify installations

docker --version

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