Open
Description
I have a question about install docker-ce in offline case:
there are two vms, one is online, another is not. I try to download the rpm of docker-ce in the online one and install it on the offline vm.
but met the following error:
[root@localhost repo]# dnf module install foo:devel
Last metadata expiration check: 0:01:53 ago on Sun 23 Oct 2022 11:30:35 PM EDT.
Unable to resolve argument foo:devel
No match for package docker-ce
Unable to resolve argument foo:devel
No match for package docker-ce-cli
Error: Problems in request:
broken groups or modules: foo:devel, foo:devel
Step to reproduce
on the online one:
- add docker-ce repo
sudo yum install -y yum-utils
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
- download rpm
yum makecache
yum install --downloadonly --installroot=/var/rpm/repo-installroot \
--releasever=8 --downloaddir=/var/rpm/repo docker-ce docker-ce-cli containerd.io docker-compose-plugin
- create repo
createrepo --database /var/rpm/repo
add module feature to rpm downloaded, following the instruction Creating a module repository from a set of RPM packages in README.md :
[root@localhost repo]# cd /var/rpm/repo
[root@localhost repo]# dir2module foo:devel:123:f32:x86_64 -m "My example module" --force --dir .
ERROR: RPM does not have `modularitylabel` header set: ./libxkbcommon-0.9.1-1.el8.x86_64.rpm
ERROR: RPM does not have `modularitylabel` header set: ./xkeyboard-config-2.28-1.el8.noarch.rpm
ERROR: RPM does not have `modularitylabel` header set: ./acl-2.2.53-1.el8.1.x86_64.rpm
// a lot of same kind of error, omit for brevity
Created foo:devel:123:f32:x86_64.modulemd.yaml
Created foo:devel:123:f32:x86_64.modulemd-defaults.yaml
[root@localhost repo]# createrepo_mod .
Directory walk started
Directory walk done - 197 packages
Temporary output repo path: ./.repodata/
Preparing sqlite DBs
Pool started (with 5 workers)
Pool finished
[root@localhost repo]# ls repodata/ |grep modules
ce7589fb16229ae9f5c31f2ba47ce60748c4d098e94dd13efd964b3c6f5748c6-modules.yaml.gz
copy the yum repo to /etc/yum.repos.d/
dir:
[root@localhost repo]# cat /etc/yum.repos.d/docker-offline.repo
[docker-offline]
name=My local foo module
baseurl=file:///var/rpm/repo
gpgcheck=0
enabled=1
and check module info:
[root@localhost repo]# dnf module info foo:devel
My local foo module 52 MB/s | 277 kB 00:00
Name : foo
Stream : devel [d][a]
Version : 123
Context : f32
Architecture :
Profiles : common [d]
Default profiles : common
Repo : docker-offline
Summary : My example module
Description : This module has been generated using dir2module tool
Requires :
Artifacts : acl-0:2.2.53-1.el8.1.x86_64
: audit-libs-0:3.0.7-2.el8.2.x86_64
: basesystem-0:11-5.el8.noarch
: bash-0:4.4.20-4.el8_6.x86_64
// a lot of list, no error at the end
[root@localhost repo]# ls |grep modulemd
foo:devel:123:f32:x86_64.modulemd-defaults.yaml
foo:devel:123:f32:x86_64.modulemd.yaml
[root@localhost repo]# pwd
/var/rpm/repo
- install the docker on the offline vm (I disconnect the internet at this point of time)
the error I can't figure out:
[root@localhost repo]# dnf module install foo:devel
Last metadata expiration check: 0:01:22 ago on Sun 23 Oct 2022 11:30:35 PM EDT.
Unable to resolve argument foo:devel
No match for package docker-ce
Unable to resolve argument foo:devel
No match for package docker-ce-cli
Error: Problems in request:
broken groups or modules: foo:devel, foo:devel
Metadata
Assignees
Labels
No labels
Activity