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
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.
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.
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
sudo dpkg -i /opt/packages/aufs-tools_3.2 20130722-1.1ubuntu1_amd64.deb
sudo dpkg -i /opt/packages/docker.io_1.13.1~ubuntu-0~20170221141433.0.dpkg
sudo service docker start
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
sudo cp /opt/packages/docker-compose-Linux-x86_64 /opt/bin/docker-compose
sudo chmod x /opt/bin/docker-compose
sudo docker-compose --version
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!