Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install docker-ce without internet and intranet yum repository?

I downloaded the RPM package from the official website, but I still need to download some dependencies when I install it. I need to install docker-ce without any network or repository at all, so I need all the RPM packages I depend on and the order in which they are installed.

Docker-CE Version: 18.03+

like image 723
Leon Avatar asked Dec 08 '18 07:12

Leon


People also ask

Can we install Docker without Internet?

To install Docker on your offline server, first download the required RPM packages onto an online server that is connected to the Red Hat repository, and then transfer the RPM packages to your offline server for installation.


3 Answers

Only way to install if there is no internet is download tar and extract.

Steps available at :- Docker Install Steps
tar can be downloaded from Binary repo

like image 149
Yash Jagdale Avatar answered Oct 04 '22 00:10

Yash Jagdale


if you don't want to install the binary file and thus configure it from scratch Docker, you can download all the RPM packages needed for your system, upload them to your offline machine, and install them.

Suppose you are on Centos 7.7, spin up a docker centos container, find all the needed dependencies. Download them. Upload and install them.

# In an online machine
docker run --rm -v ${PWD}/bin:/tmp -it centos:7.7.1908 bash # Run an online container similar to your offline machine
# In the online container:
cd /tmp
yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo # Add Docker repo
yum makecache fast # Update Yum cache
yum list docker-ce --showduplicates | sort -r # Choose a version
yumdownloader --resolve docker-ce-20.10.5-3.el7 # Download all non-installed RPM depencencies

Upload all the RPM packages to your offline machine. You can make a tar out of them:

tar cvzf docker-rpm-deps.tar.gz * # Create an archive of all the RPMs

Install all the RPMs

# In the offline machine
tar xzvf docker-rpm-deps.tar.gz -C /tmp # Exctract archive
cd /tmp
rpm -ivh --replacefiles --replacepkgs *.rpm # Install all .rpm in the current folder

Voila! Now you just need to enable and start docker.

systemctl enable docker.service
systemctl start docker.service

If, when you are in the offline machine, you still miss an RPM package you can download all the needed RPMs with the command below

# Instead of using yumdownloader
repotrack -a x86_64 -p ./docker-rpm-pkgs docker-ce-20.10.5-3.el7 # Download all RPM dependencies, even the already installed ones
like image 37
Naramsim Avatar answered Oct 04 '22 01:10

Naramsim


you must download the DEB package and install it manually and manage upgrades completely manually. This is useful in situations such as installing Docker on air-gapped systems with no access to the internet.

Install from a package

If you cannot use Docker’s repository to install Docker CE, you can download the .deb file for your release and install it manually. You will need to download a new file each time you want to upgrade Docker CE.

1.Go to [https://download.docker.com/linux/ubuntu/dists/], choose your Ubuntu version, browse to pool/stable/ and choose amd64, armhf, ppc64el, or s390x. Download the .deb file for the Docker version you want to install.

Note: To install an edge package, change the word stable in the URL to edge.

  • Install Docker CE, changing the path below to the path where you downloaded the Docker package.

  • $ sudo dpkg -i /path/to/package.deb

and run

  • $ sudo docker version

    to peresent docker version and succeed of inestallation.

like image 40
MohammadReza Avatar answered Oct 04 '22 01:10

MohammadReza