Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into dphulkar/syscontainer
  • Loading branch information
dphulkar-msft committed Dec 4, 2024
2 parents 3855acf + 8ae772c commit 78e4f37
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions docker/dockerinstall.sh
Original file line number Diff line number Diff line change
@@ -1,40 +1,35 @@
# Cleanup old installation
sudo apt remove docker-desktop
sudo apt remove -y docker-desktop
sudo apt-get remove -y docker docker-engine docker.io containerd runc
rm -r $HOME/.docker/desktop
sudo rm /usr/local/bin/com.docker.cli
sudo apt purge docker-desktop
sudo apt purge -y docker-desktop
sudo apt-get update

# Install certificates and pre-requisites
sudo apt-get install ca-certificates curl gnupg lsb-release -y
sudo mkdir -p /etc/apt/keyrings
sudo apt-get install -y ca-certificates curl gnupg lsb-release

# Create keyring for docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg -y
sudo mkdir -m 0755 -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

# Create file for installation
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"| sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

# Install docker
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y
# Install docker
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin

# Resolve permission issues to connect to docker socket
sudo groupadd docker
sudo usermod -aG docker $USER
sudo chown root:docker /var/run/docker.sock
# Verify installation
docker --version
sudo docker run hello-world

# Create the .docker directory if it doesn't exist
mkdir -p $HOME/.docker
sudo chown "$USER":"$USER" /home/"$USER"/.docker -R
sudo chmod g+rwx "$HOME/.docker" -R

# Delete old azcopy image
docker rmi `docker images | grep azcopy | cut -d " " -f1`

# Remove existing images
docker system prune -f
docker system prune -f -a

# Start docker service
sudo service docker start
Expand Down

0 comments on commit 78e4f37

Please sign in to comment.