Home > Operation and Maintenance > Docker > How to install docker offline

How to install docker offline

PHPz
Release: 2023-05-16 19:30:37
Original
15297 people have browsed it

In some network environments, Docker cannot be installed online, such as some highly closed security environments or areas without reliable Internet connections. In this case, we can use Docker's offline installation method. This article will introduce how to install Docker in an offline environment.

1. Download the required software package

  1. Download the required Docker software package on a machine that can connect to the Internet. For example, in Ubuntu environment, you can use the command:

sudo apt-get install docker.io

Then save the Docker package on a removable device such as a USB disk or DVD for use in an offline environment.

  1. Download the required dependency packages.

In the Linux operating system, Docker depends on some software packages, such as aufs-tools, cgroupfs-mount, etc. These packages can be downloaded on the official Linux website.

  1. Download Docker-Compose.

The function of Docker-Compose is to use simple declaration statements to define multiple containers required by Docker applications, and to start or stop these containers through a command. For the installation of Docker-Compose, please refer to the official documentation (https://docs.docker.com/compose/install/).

2. Copy the software package to the offline environment

In the offline environment, copy the previously downloaded Docker software package and required dependent software from a removable storage device such as USB or DVD Bag. Place these packages in a directory such as /opt/packages.

3. Install Docker

  1. First install the required dependent software packages. In Ubuntu, you can use the dpkg command to install, for example:

sudo dpkg -i /opt/packages/aufs-tools_3.2 20130722-1.1ubuntu1_amd64.deb

  1. Install Docker. Also use dpkg to install.

sudo dpkg -i /opt/packages/docker.io_1.13.1~ubuntu-0~20170221141433.0.dpkg

  1. Start Docker service

sudo service docker start

  1. Verify whether the installation is successful

sudo docker run hello-world

If the installation is successful, "Hello from Docker!" will be returned. If an error message appears, it means that the installation is incomplete or incorrect.

4. Install Docker-Compose

  1. Copy the downloaded Docker-Compose software package to the /opt/bin directory, for example:

sudo cp /opt/packages/docker-compose-Linux-x86_64 /opt/bin/docker-compose

    ##Add execution permissions to Docker-Compose.

sudo chmod x /opt/bin/docker-compose

    Verify whether the installation is successful

sudo docker-compose --version

If the installation is successful, the version number will be returned.

Summary

Whether you are installing Docker online or offline, the key is to master the download and installation of Docker's main software packages and dependent packages. In a highly closed environment, installing Docker offline is the best choice to solve Docker deployment problems. Whether installing online or offline, you need to fully understand the version and details of the operating system in order to get the best Docker deployment experience.

The above is the detailed content of How to install docker offline. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template