Ubuntu: Install docker offline

Summary : Installing Docker offline on Ubuntu requires downloading the Docker installation package and its dependencies on a network-connected device beforehand, and then transferring those files to the target Ubuntu device for installation.

History Raiders:

ubuntu uninstall docker

centos7.6: install docker

Steps to install Docker offline:

1. Download the Docker installation package and dependencies on a device with a network connection : First, visit the official Docker documentation to find the Docker installation package download link for your version of Ubuntu. For example, assuming you want to install Docker on Ubuntu 20.04 (Focal Fossa), you need to download the following packages:

docker-ce(Docker 社区版)
docker-ce-cli(Docker 命令行接口)
containerd.io(容器运行时)

On a device with a network connection, use the wget command to download these packages:

wget https://download.docker.com/linux/ubuntu/dists/focal/pool/stable/amd64/containerd.io_1.4.12_amd64.deb
wget https://download.docker.com/linux/ubuntu/dists/focal/pool/stable/amd64/docker-ce-cli_20.10.12_amd64.deb
wget https://download.docker.com/linux/ubuntu/dists/focal/pool/stable/amd64/docker-ce_20.10.12_amd64.deb

Note: Please replace the above link according to your Ubuntu version and Docker version. The version here may be outdated, please consult the official Docker documentation for the latest version.

2. Transfer the downloaded installation package to the target Ubuntu device : You can use USB storage device, SCP, SFTP and other methods to transfer the installation package from the device with network connection to the target Ubuntu device.

3. Install dependencies and Docker on the target Ubuntu device : Move the installation package transferred to the target device to a separate directory, then run the following command in that directory to install:

sudo dpkg -i containerd.io_1.4.12_amd64.deb
sudo dpkg -i docker-ce-cli_20.10.12_amd64.deb
sudo dpkg -i docker-ce_20.10.12_amd64.deb

Note: Please replace the version number in the above command with the actual downloaded file name.

4. Start and verify the Docker installation:

Start the Docker service:

sudo systemctl start docker

Set the Docker service to start automatically at boot:

sudo systemctl enable docker

Verify that Docker was successfully installed:

sudo docker --version
sudo docker run hello-world

If Docker installed successfully, you'll see the Docker version information and a "Hello from Docker!" message.

Guess you like

Origin blog.csdn.net/hzblucky1314/article/details/130355681