diff --git a/Docker.md b/Docker.md index 47a1bd5..958e13d 100644 --- a/Docker.md +++ b/Docker.md @@ -2,15 +2,15 @@ Firstly, you need to update your OS else they may occur problems during installations. ``` -$sudo apt update -$sudo apt upgrade +$ sudo apt update +$ sudo apt upgrade ``` ##### Fix Network Issues ``` -$sudo su +$ sudo su // Delete auto-generated files -#rm /etc/resolv.conf || true -#rm /etc/wsl.conf || true +# rm /etc/resolv.conf || true +# rm /etc/wsl.conf || true //Enable changing /etc/resolv.conf //Enable extended attributes on Windows drives @@ -32,31 +32,31 @@ EOF ``` ##### Installation of Docker ``` -$sudo -l # To ensure that we can run apt as root -$sudo apt install -y lsb-release -$sudo apt install -y curl -$curl -V # Ensure that curl is installed and in a modern version -$sudo apt install software-properties-common +$ sudo -l # To ensure that we can run apt as root +$ sudo apt install -y lsb-release +$ sudo apt install -y curl +$ curl -V # Ensure that curl is installed and in a modern version +$ sudo apt install software-properties-common -$curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg # To add the gpg key on our keyring +$ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg # To add the gpg key on our keyring echo \ "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null //Add the official repo on apt or any other package manager -$sudo apt install -y docker-ce # Actually installing docker -$sudo usermod -aG docker $USER # Add current user to the docker group -$su - ${USER} # Reload our shell +$ sudo apt install -y docker-ce # Actually installing docker +$ sudo usermod -aG docker $USER # Add current user to the docker group +$ su - ${USER} # Reload our shell -$docker --version # See the docker version -$docker run hello-world # Test if docker really works +$ docker --version # See the docker version +$ docker run hello-world # Test if docker really works ``` ##### Fix "x509: certificate signed by unknown authority" issue ``` -$sudo su -#touch set-ca.sh +$ sudo su +# touch set-ca.sh registry_address=hub.swarmlab.io registry_port=5443 @@ -67,12 +67,12 @@ registry_port=5480 mkdir -p /etc/docker/certs.d/$registry_address:$registry_port openssl s_client -showcerts -connect $registry_address:$registry_port < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /etc/docker/certs.d/$registry_address:$registry_port/ca.crt -$sudo bash ./set-ca.sh +$ sudo bash ./set-ca.sh ``` ##### Docker-Compose ``` -$sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose -$sudo chmod +x /usr/local/bin/docker-compose -$sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose +$ sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose +$ sudo chmod +x /usr/local/bin/docker-compose +$ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose ```