Install Docker
& Docker-Compose on Linux distro`s (offline / without internet)
This method can help if systems are not having internet
connections.
Make sure uninstall or remove the older version of docker,
if installed already.
Uninstallation Steps:
Step 1: dpkg -l | grep -i docker
Step2: sudo apt-get
purge -y docker-engine docker docker.io docker-ce
Step3: sudo apt-get
autoremove -y --purge docker-engine docker docker.io docker-ce
Step4: sudo rm -rf
/var/lib/docker /etc/docker
Step5: sudo rm
/etc/apparmor.d/docker
Step6: sudo groupdel
docker
Step7: sudo rm -rf /var/run/docker.sock
Step8: sudo snap remove docker
Step9: sudo docker -v (optional)
Docker Offline installation steps:
Below commands will help us to get the Linux distro versions
& Names:
cat /proc/version
cat /etc/*release
Click the below link to navigate the docker Linux
distribution list.
https://download.docker.com/linux/
Click the below link to navigate the
docker Windows.
Download the latest version zip file.
Index of
win/static/stable/x86_64/ (docker.com)
Here we have selected Ubuntu Linux distribution
Download the respective os
packages from the below links
For Ubuntu:
Download the highlighted or latest version packages to your system.
For CentOS:
Copy the downloaded packages to the
system which you wanted to install the docker
If you downloaded the packages in
Linux (CentOS / Ubuntu ) & want to copy to another Linux.
sudo cp -rf *.deb
/path/to/package/directory/of/the/destination/system
eg: sudo cp -rf
packages_directory/*.deb /home/Certscan/packages
We must follow the sequence while
proceed with docker installation.
1. sudo
dpkg -i containerd.io_1.4.6-1_amd64.deb
2. sudo dpkg -i docker-ce-cli_20.10.7~3-0~ubuntu-focal_amd64.deb
3. sudo
dpkg -i docker-ce_20.10.7~3-0~ubuntu-focal_amd64.deb
Validate the docker installation by
using the below command.
$
sudo docker -v
$
sudo docker run hello-world
Install
Docker Compose Offline
Step1: Download the package on a
system which has internet connectivity.
From Browser: https://github.com/docker/compose/releases/download/1.24.0/docker-compose-Linux-x86_64
From Linux Terminal:
Open Terminal and run the below
command.
wget https://github.com/docker/compose/releases/download/1.24.0/docker-compose-Linux-x86_64
if wget not installed in your
Linux
Ubuntu: sudo apt-get install
wget -y
CentOS / RHEL: sudo yum install
wget -y
Step2: Rename the downloaded
package in Linux.
mv docker-compose-Linux-x86_64 docker-compose
Step3: Copy the renamed file into
destination machine using SCP or Winscp.
From Windows PowerShell to Linux:
scp -r
localmachine/path_to_the_directory/
username@server_ip:/path_to_remote_directory/
Ex: scp -r C:\Users\gd\Downloads\docker-compose
test@10.204.211.118:/home/test/
From Linux to Linux:
sudo cp -rf docker-compose test@10.204.211.118:/home/test
Step4: Make the copied docker
compose package with Executable permissions.
sudo mv docker-compose
/usr/local/bin/
sudo chmod +x
/usr/local/bin/docker-compose
Step5: verify the docker-compose
version.
sudo docker-compose -v