From 8ae772c89a2b0c0d1697fe8a9c2e2139efd34e78 Mon Sep 17 00:00:00 2001 From: dphulkar-msft <166800991+dphulkar-msft@users.noreply.github.com> Date: Wed, 4 Dec 2024 18:57:50 +0530 Subject: [PATCH] Fix Docker publish for ARM image (#2885) --- docker/dockerinstall.sh | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/docker/dockerinstall.sh b/docker/dockerinstall.sh index 46a3aad87..52c122355 100644 --- a/docker/dockerinstall.sh +++ b/docker/dockerinstall.sh @@ -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