docker install
[root@iZgfrv9gike8qaZ ~]# docker --help
-bash: docker: command not found
[root@iZgfrv9gike8qaZ ~]# dnf
usage: dnf [options] COMMAND
List of Main Commands:
alias List or create command aliases
autoremove remove all unneeded packages that were originally installed as dependencies
check check for problems in the packagedb
check-update check for available package upgrades
clean remove cached data
deplist [deprecated, use repoquery --deplist] List package's dependencies and what packages provide them
distro-sync synchronize installed packages to the latest available versions
downgrade Downgrade a package
group display, or use, the groups information
help display a helpful usage message
history display, or use, the transaction history
info display details about a package or group of packages
install install a package or packages on your system
list list a package or groups of packages
makecache generate the metadata cache
mark mark or unmark installed packages as installed by user.
module Interact with Modules.
provides find what package provides the given value
reinstall reinstall a package
remove remove a package or packages from your system
repolist display the configured software repositories
repoquery search for packages matching keyword
repository-packages run commands on top of all packages in given repository
search search package details for the given string
shell run an interactive DNF shell
swap run an interactive DNF mod for remove and install one spec
updateinfo display advisories about packages
upgrade upgrade a package or packages on your system
upgrade-minimal upgrade, but only 'newest' package match which fixes a problem that affects your system
List of Plugin Commands:
builddep Install build dependencies for package or spec file
changelog Show changelog data of packages
config-manager manage dnf configuration options and repositories
copr Interact with Copr repositories.
debug-dump dump information about installed rpm packages to file
debug-restore restore packages recorded in debug-dump file
debuginfo-install install debuginfo packages
download Download package to current directory
groups-manager create and edit groups metadata file
kpatch Toggles automatic installation of kpatch-patch packages
needs-restarting determine updated binaries that need restarting
offline-distrosync Prepare offline distrosync of the system
offline-upgrade Prepare offline upgrade of the system
playground Interact with Playground repository.
repoclosure Display a list of unresolved dependencies for repositories
repodiff List differences between two sets of repositories
repograph Output a full package dependency graph in dot format
repomanage Manage a directory of rpm packages
reposync download all packages from remote repo
system-upgrade Prepare system for upgrade to a new release
General DNF options:
-c [config file], --config [config file]
config file location
-q, --quiet quiet operation
-v, --verbose verbose operation
--version show DNF version and exit
--installroot [path] set install root
--nodocs do not install documentations
--noplugins disable all plugins
--enableplugin [plugin]
enable plugins by name
--disableplugin [plugin]
disable plugins by name
--releasever RELEASEVER
override the value of $releasever in config and repo
files
--setopt SETOPTS set arbitrary config and repo options
--skip-broken resolve depsolve problems by skipping packages
-h, --help, --help-cmd
show command help
--allowerasing allow erasing of installed packages to resolve
dependencies
-b, --best try the best available package versions in
transactions.
--nobest do not limit the transaction to the best candidate
-C, --cacheonly run entirely from system cache, don't update cache
-R [minutes], --randomwait [minutes]
maximum command wait time
-d [debug level], --debuglevel [debug level]
debugging output level
--debugsolver dumps detailed solving results into files
--showduplicates show duplicates, in repos, in list/search commands
-e ERRORLEVEL, --errorlevel ERRORLEVEL
error output level
--obsoletes enables dnf's obsoletes processing logic for upgrade
or display capabilities that the package obsoletes for
info, list and repoquery
--rpmverbosity [debug level name]
debugging output level for rpm
-y, --assumeyes automatically answer yes for all questions
--assumeno automatically answer no for all questions
--enablerepo [repo] Enable additional repositories. List option. Supports
globs, can be specified multiple times.
--disablerepo [repo] Disable repositories. List option. Supports globs, can
be specified multiple times.
--repo [repo], --repoid [repo]
enable just specific repositories by an id or a glob,
can be specified multiple times
--enable enable repos with config-manager command
(automatically saves)
--disable disable repos with config-manager command
(automatically saves)
-x [package], --exclude [package], --excludepkgs [package]
exclude packages by name or glob
--disableexcludes [repo], --disableexcludepkgs [repo]
disable excludepkgs
--repofrompath [repo,path]
label and path to an additional repository to use
(same path as in a baseurl), can be specified multiple
times.
--noautoremove disable removal of dependencies that are no longer
used
--nogpgcheck disable gpg signature checking (if RPM policy allows)
--color COLOR control whether color is used
--refresh set metadata as expired before running the command
-4 resolve to IPv4 addresses only
-6 resolve to IPv6 addresses only
--destdir DESTDIR, --downloaddir DESTDIR
set directory to copy packages to
--downloadonly only download packages
--comment COMMENT add a comment to transaction
--bugfix Include bugfix relevant packages, in updates
--enhancement Include enhancement relevant packages, in updates
--newpackage Include newpackage relevant packages, in updates
--security Include security relevant packages, in updates
--advisory ADVISORY, --advisories ADVISORY
Include packages needed to fix the given advisory, in
updates
--bz BUGZILLA, --bzs BUGZILLA
Include packages needed to fix the given BZ, in
updates
--cve CVES, --cves CVES
Include packages needed to fix the given CVE, in
updates
--sec-severity {Critical,Important,Moderate,Low}, --secseverity {Critical,Important,Moderate,Low}
Include security relevant packages matching the
severity, in updates
--forcearch ARCH Force the use of an architecture
[root@iZgfrv9gike8qaZ ~]# sudo dnf remove docker \
> docker-client \
> docker-client-latest \
> docker-common \
> docker-latest \
> docker-latest-logrotate \
> docker-logrotate \
> docker-engine
No match for argument: docker
No match for argument: docker-client
No match for argument: docker-client-latest
No match for argument: docker-common
No match for argument: docker-latest
No match for argument: docker-latest-logrotate
No match for argument: docker-logrotate
No match for argument: docker-engine
No packages marked for removal.
Dependencies resolved.
Nothing to do.
Complete!
[root@iZgfrv9gike8qaZ ~]# sudo dnf -y install dnf-plugins-core
Last metadata expiration check: 0:57:17 ago on Mon 21 Apr 2025 09:17:14 PM CST.
Package dnf-plugins-core-4.0.21-19.an8.noarch is already installed.
Dependencies resolved.
==============================================================================================================================================
Package Architecture Version Repository Size
==============================================================================================================================================
Upgrading:
dnf-plugins-core noarch 4.0.21-25.an8 BaseOS 75 k
python3-dnf-plugin-post-transaction-actions noarch 4.0.21-25.an8 BaseOS 57 k
python3-dnf-plugins-core noarch 4.0.21-25.an8 BaseOS 262 k
Transaction Summary
==============================================================================================================================================
Upgrade 3 Packages
Total download size: 394 k
Downloading Packages:
(1/3): python3-dnf-plugin-post-transaction-actions-4.0.21-25.an8.noarch.rpm 638 kB/s | 57 kB 00:00
(2/3): dnf-plugins-core-4.0.21-25.an8.noarch.rpm 559 kB/s | 75 kB 00:00
(3/3): python3-dnf-plugins-core-4.0.21-25.an8.noarch.rpm 1.9 MB/s | 262 kB 00:00
----------------------------------------------------------------------------------------------------------------------------------------------
Total 2.7 MB/s | 394 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: python3-dnf-plugins-core-4.0.21-25.an8.noarch 1/1
Upgrading : python3-dnf-plugins-core-4.0.21-25.an8.noarch 1/6
Upgrading : dnf-plugins-core-4.0.21-25.an8.noarch 2/6
Upgrading : python3-dnf-plugin-post-transaction-actions-4.0.21-25.an8.noarch 3/6
Cleanup : python3-dnf-plugin-post-transaction-actions-4.0.21-19.an8.noarch 4/6
Cleanup : dnf-plugins-core-4.0.21-19.an8.noarch 5/6
Cleanup : python3-dnf-plugins-core-4.0.21-19.an8.noarch 6/6
Running scriptlet: python3-dnf-plugins-core-4.0.21-19.an8.noarch 6/6
Verifying : dnf-plugins-core-4.0.21-25.an8.noarch 1/6
Verifying : dnf-plugins-core-4.0.21-19.an8.noarch 2/6
Verifying : python3-dnf-plugin-post-transaction-actions-4.0.21-25.an8.noarch 3/6
Verifying : python3-dnf-plugin-post-transaction-actions-4.0.21-19.an8.noarch 4/6
Verifying : python3-dnf-plugins-core-4.0.21-25.an8.noarch 5/6
Verifying : python3-dnf-plugins-core-4.0.21-19.an8.noarch 6/6
Upgraded:
dnf-plugins-core-4.0.21-25.an8.noarch python3-dnf-plugin-post-transaction-actions-4.0.21-25.an8.noarch
python3-dnf-plugins-core-4.0.21-25.an8.noarch
Complete!
[root@iZgfrv9gike8qaZ ~]# sudo dnf config-manager --add-repo \
> http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
Adding repo from: http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
[root@iZgfrv9gike8qaZ ~]# sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Docker CE Stable - x86_64 244 kB/s | 66 kB 00:00
Dependencies resolved.
==============================================================================================================================================
Package Architecture Version Repository Size
==============================================================================================================================================
Installing:
containerd.io x86_64 1.6.32-3.1.el8 docker-ce-stable 35 M
docker-buildx-plugin x86_64 0.14.0-1.el8 docker-ce-stable 14 M
docker-ce x86_64 3:26.1.3-1.el8 docker-ce-stable 27 M
docker-ce-cli x86_64 1:26.1.3-1.el8 docker-ce-stable 7.8 M
docker-compose-plugin x86_64 2.27.0-1.el8 docker-ce-stable 13 M
Installing dependencies:
container-selinux noarch 2:2.229.0-2.module+an8.9.0+11261+8fb088a9 AppStream 70 k
fuse-overlayfs x86_64 1.13-1.0.1.module+an8.9.0+11261+8fb088a9 AppStream 69 k
fuse3 x86_64 3.3.0-19.an8 BaseOS 54 k
fuse3-libs x86_64 3.3.0-19.an8 BaseOS 95 k
libcgroup x86_64 2.0-1.0.1.an8 BaseOS 78 k
libslirp x86_64 4.4.0-2.module+an8.9.0+11257+d476ec85 AppStream 69 k
slirp4netns x86_64 1.2.3-1.module+an8.9.0+11261+8fb088a9 AppStream 55 k
Installing weak dependencies:
docker-ce-rootless-extras x86_64 26.1.3-1.el8 docker-ce-stable 5.0 M
Enabling module streams:
container-tools an8
Transaction Summary
==============================================================================================================================================
Install 13 Packages
Total download size: 103 M
Installed size: 390 M
Is this ok [y/N]: Operation aborted.
[root@iZgfrv9gike8qaZ ~]# sudo systemctl enable --now docker
Failed to enable unit: Unit file docker.service does not exist.
[root@iZgfrv9gike8qaZ ~]# docker --hlep
-bash: docker: command not found
[root@iZgfrv9gike8qaZ ~]# docker
-bash: docker: command not found
[root@iZgfrv9gike8qaZ ~]# dockersudo systemctl start docker
-bash: dockersudo: command not found
[root@iZgfrv9gike8qaZ ~]# sudo systemctl start docker
Failed to start docker.service: Unit docker.service not found.
[root@iZgfrv9gike8qaZ ~]# sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Last metadata expiration check: 0:09:03 ago on Mon 21 Apr 2025 10:15:11 PM CST.
Dependencies resolved.
==============================================================================================================================================
Package Architecture Version Repository Size
==============================================================================================================================================
Installing:
containerd.io x86_64 1.6.32-3.1.el8 docker-ce-stable 35 M
docker-buildx-plugin x86_64 0.14.0-1.el8 docker-ce-stable 14 M
docker-ce x86_64 3:26.1.3-1.el8 docker-ce-stable 27 M
docker-ce-cli x86_64 1:26.1.3-1.el8 docker-ce-stable 7.8 M
docker-compose-plugin x86_64 2.27.0-1.el8 docker-ce-stable 13 M
Installing dependencies:
container-selinux noarch 2:2.229.0-2.module+an8.9.0+11261+8fb088a9 AppStream 70 k
fuse-overlayfs x86_64 1.13-1.0.1.module+an8.9.0+11261+8fb088a9 AppStream 69 k
fuse3 x86_64 3.3.0-19.an8 BaseOS 54 k
fuse3-libs x86_64 3.3.0-19.an8 BaseOS 95 k
libcgroup x86_64 2.0-1.0.1.an8 BaseOS 78 k
libslirp x86_64 4.4.0-2.module+an8.9.0+11257+d476ec85 AppStream 69 k
slirp4netns x86_64 1.2.3-1.module+an8.9.0+11261+8fb088a9 AppStream 55 k
Installing weak dependencies:
docker-ce-rootless-extras x86_64 26.1.3-1.el8 docker-ce-stable 5.0 M
Enabling module streams:
container-tools an8
Transaction Summary
==============================================================================================================================================
Install 13 Packages
Total download size: 103 M
Installed size: 390 M
Is this ok [y/N]: y
Downloading Packages:
(1/13): fuse-overlayfs-1.13-1.0.1.module+an8.9.0+11261+8fb088a9.x86_64.rpm 686 kB/s | 69 kB 00:00
(2/13): libslirp-4.4.0-2.module+an8.9.0+11257+d476ec85.x86_64.rpm 587 kB/s | 69 kB 00:00
(3/13): container-selinux-2.229.0-2.module+an8.9.0+11261+8fb088a9.noarch.rpm 534 kB/s | 70 kB 00:00
(4/13): slirp4netns-1.2.3-1.module+an8.9.0+11261+8fb088a9.x86_64.rpm 656 kB/s | 55 kB 00:00
(5/13): fuse3-libs-3.3.0-19.an8.x86_64.rpm 1.0 MB/s | 95 kB 00:00
(6/13): fuse3-3.3.0-19.an8.x86_64.rpm 390 kB/s | 54 kB 00:00
(7/13): libcgroup-2.0-1.0.1.an8.x86_64.rpm 894 kB/s | 78 kB 00:00
(8/13): docker-buildx-plugin-0.14.0-1.el8.x86_64.rpm 4.4 MB/s | 14 MB 00:03
(9/13): docker-ce-26.1.3-1.el8.x86_64.rpm 5.5 MB/s | 27 MB 00:04
(10/13): docker-ce-cli-26.1.3-1.el8.x86_64.rpm 3.4 MB/s | 7.8 MB 00:02
(11/13): docker-ce-rootless-extras-26.1.3-1.el8.x86_64.rpm 4.5 MB/s | 5.0 MB 00:01
(12/13): containerd.io-1.6.32-3.1.el8.x86_64.rpm 4.7 MB/s | 35 MB 00:07
(13/13): docker-compose-plugin-2.27.0-1.el8.x86_64.rpm 5.5 MB/s | 13 MB 00:02
----------------------------------------------------------------------------------------------------------------------------------------------
Total 13 MB/s | 103 MB 00:08
Docker CE Stable - x86_64 16 kB/s | 1.6 kB 00:00
Importing GPG key 0x621E9F35:
Userid : "Docker Release (CE rpm) <docker@docker.com>"
Fingerprint: 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35
From : https://mirrors.aliyun.com/docker-ce/linux/centos/gpg
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : docker-compose-plugin-2.27.0-1.el8.x86_64 1/13
Running scriptlet: docker-compose-plugin-2.27.0-1.el8.x86_64 1/13
Installing : fuse3-libs-3.3.0-19.an8.x86_64 2/13
Running scriptlet: fuse3-libs-3.3.0-19.an8.x86_64 2/13
Running scriptlet: container-selinux-2:2.229.0-2.module+an8.9.0+11261+8fb088a9.noarch 3/13
Installing : container-selinux-2:2.229.0-2.module+an8.9.0+11261+8fb088a9.noarch 3/13
Running scriptlet: container-selinux-2:2.229.0-2.module+an8.9.0+11261+8fb088a9.noarch 3/13
Installing : containerd.io-1.6.32-3.1.el8.x86_64 4/13
Running scriptlet: containerd.io-1.6.32-3.1.el8.x86_64 4/13
Installing : fuse3-3.3.0-19.an8.x86_64 5/13
Installing : fuse-overlayfs-1.13-1.0.1.module+an8.9.0+11261+8fb088a9.x86_64 6/13
Running scriptlet: fuse-overlayfs-1.13-1.0.1.module+an8.9.0+11261+8fb088a9.x86_64 6/13
Installing : docker-buildx-plugin-0.14.0-1.el8.x86_64 7/13
Running scriptlet: docker-buildx-plugin-0.14.0-1.el8.x86_64 7/13
Installing : docker-ce-cli-1:26.1.3-1.el8.x86_64 8/13
Running scriptlet: docker-ce-cli-1:26.1.3-1.el8.x86_64 8/13
Installing : libcgroup-2.0-1.0.1.an8.x86_64 9/13
Installing : libslirp-4.4.0-2.module+an8.9.0+11257+d476ec85.x86_64 10/13
Installing : slirp4netns-1.2.3-1.module+an8.9.0+11261+8fb088a9.x86_64 11/13
Installing : docker-ce-rootless-extras-26.1.3-1.el8.x86_64 12/13
Running scriptlet: docker-ce-rootless-extras-26.1.3-1.el8.x86_64 12/13
Installing : docker-ce-3:26.1.3-1.el8.x86_64 13/13
Running scriptlet: docker-ce-3:26.1.3-1.el8.x86_64 13/13
Running scriptlet: container-selinux-2:2.229.0-2.module+an8.9.0+11261+8fb088a9.noarch 13/13
Running scriptlet: docker-ce-3:26.1.3-1.el8.x86_64 13/13
Verifying : container-selinux-2:2.229.0-2.module+an8.9.0+11261+8fb088a9.noarch 1/13
Verifying : fuse-overlayfs-1.13-1.0.1.module+an8.9.0+11261+8fb088a9.x86_64 2/13
Verifying : libslirp-4.4.0-2.module+an8.9.0+11257+d476ec85.x86_64 3/13
Verifying : slirp4netns-1.2.3-1.module+an8.9.0+11261+8fb088a9.x86_64 4/13
Verifying : fuse3-3.3.0-19.an8.x86_64 5/13
Verifying : fuse3-libs-3.3.0-19.an8.x86_64 6/13
Verifying : libcgroup-2.0-1.0.1.an8.x86_64 7/13
Verifying : containerd.io-1.6.32-3.1.el8.x86_64 8/13
Verifying : docker-buildx-plugin-0.14.0-1.el8.x86_64 9/13
Verifying : docker-ce-3:26.1.3-1.el8.x86_64 10/13
Verifying : docker-ce-cli-1:26.1.3-1.el8.x86_64 11/13
Verifying : docker-ce-rootless-extras-26.1.3-1.el8.x86_64 12/13
Verifying : docker-compose-plugin-2.27.0-1.el8.x86_64 13/13
Installed:
container-selinux-2:2.229.0-2.module+an8.9.0+11261+8fb088a9.noarch containerd.io-1.6.32-3.1.el8.x86_64
docker-buildx-plugin-0.14.0-1.el8.x86_64 docker-ce-3:26.1.3-1.el8.x86_64
docker-ce-cli-1:26.1.3-1.el8.x86_64 docker-ce-rootless-extras-26.1.3-1.el8.x86_64
docker-compose-plugin-2.27.0-1.el8.x86_64 fuse-overlayfs-1.13-1.0.1.module+an8.9.0+11261+8fb088a9.x86_64
fuse3-3.3.0-19.an8.x86_64 fuse3-libs-3.3.0-19.an8.x86_64
libcgroup-2.0-1.0.1.an8.x86_64 libslirp-4.4.0-2.module+an8.9.0+11257+d476ec85.x86_64
slirp4netns-1.2.3-1.module+an8.9.0+11261+8fb088a9.x86_64
Complete!
[root@iZgfrv9gike8qaZ ~]# ls /etc/systemd/system/docker.service
ls: cannot access '/etc/systemd/system/docker.service': No such file or directory
[root@iZgfrv9gike8qaZ ~]# whereis docker
docker: /usr/bin/docker /etc/docker /usr/libexec/docker /usr/share/man/man1/docker.1.gz
[root@iZgfrv9gike8qaZ ~]# sudo systemctl enable --now docker
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service.
[root@iZgfrv9gike8qaZ ~]# docker --version
Docker version 26.1.3, build b72abbb
[root@iZgfrv9gike8qaZ ~]# docker --help
Usage: docker [OPTIONS] COMMAND
A self-sufficient runtime for containers
Common Commands:
run Create and run a new container from an image
exec Execute a command in a running container
ps List containers
build Build an image from a Dockerfile
pull Download an image from a registry
push Upload an image to a registry
images List images
login Log in to a registry
logout Log out from a registry
search Search Docker Hub for images
version Show the Docker version information
info Display system-wide information
Management Commands:
builder Manage builds
buildx* Docker Buildx
compose* Docker Compose
container Manage containers
context Manage contexts
image Manage images
manifest Manage Docker image manifests and manifest lists
network Manage networks
plugin Manage plugins
system Manage Docker
trust Manage trust on Docker images
volume Manage volumes
Swarm Commands:
swarm Manage Swarm
Commands:
attach Attach local standard input, output, and error streams to a running container
commit Create a new image from a container's changes
cp Copy files/folders between a container and the local filesystem
create Create a new container
diff Inspect changes to files or directories on a container's filesystem
events Get real time events from the server
export Export a container's filesystem as a tar archive
history Show the history of an image
import Import the contents from a tarball to create a filesystem image
inspect Return low-level information on Docker objects
kill Kill one or more running containers
load Load an image from a tar archive or STDIN
logs Fetch the logs of a container
pause Pause all processes within one or more containers
port List port mappings or a specific mapping for the container
rename Rename a container
restart Restart one or more containers
rm Remove one or more containers
rmi Remove one or more images
save Save one or more images to a tar archive (streamed to STDOUT by default)
start Start one or more stopped containers
stats Display a live stream of container(s) resource usage statistics
stop Stop one or more running containers
tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
top Display the running processes of a container
unpause Unpause all processes within one or more containers
update Update configuration of one or more containers
wait Block until one or more containers stop, then print their exit codes
Global Options:
--config string Location of client config files (default "/root/.docker")
-c, --context string Name of the context to use to connect to the daemon (overrides DOCKER_HOST env var and default context set
with "docker context use")
-D, --debug Enable debug mode
-H, --host list Daemon socket to connect to
-l, --log-level string Set the logging level ("debug", "info", "warn", "error", "fatal") (default "info")
--tls Use TLS; implied by --tlsverify
--tlscacert string Trust certs signed only by this CA (default "/root/.docker/ca.pem")
--tlscert string Path to TLS certificate file (default "/root/.docker/cert.pem")
--tlskey string Path to TLS key file (default "/root/.docker/key.pem")
--tlsverify Use TLS and verify the remote
-v, --version Print version information and quit
Run 'docker COMMAND --help' for more information on a command.
For more help on how to use Docker, head to https://docs.docker.com/go/guides/
[root@iZgfrv9gike8qaZ ~]#
|
|
[root@iZgfrv9gike8qaZ ~]# docker --help -bash: docker: command not found [root@iZgfrv9gike8qaZ ~]# dnf usage: dnf [options] COMMAND List of Main Commands: alias List or create command aliases autoremove remove all unneeded packages that were originally installed as dependencies check check for problems in the packagedb check-update check for available package upgrades clean remove cached data deplist [deprecated, use repoquery --deplist] List package's dependencies and what packages provide them distro-sync synchronize installed packages to the latest available versions downgrade Downgrade a package group display, or use, the groups information help display a helpful usage message history display, or use, the transaction history info display details about a package or group of packages install install a package or packages on your system list list a package or groups of packages makecache generate the metadata cache mark mark or unmark installed packages as installed by user. module Interact with Modules. provides find what package provides the given value reinstall reinstall a package remove remove a package or packages from your system repolist display the configured software repositories repoquery search for packages matching keyword repository-packages run commands on top of all packages in given repository search search package details for the given string shell run an interactive DNF shell swap run an interactive DNF mod for remove and install one spec updateinfo display advisories about packages upgrade upgrade a package or packages on your system upgrade-minimal upgrade, but only 'newest' package match which fixes a problem that affects your system List of Plugin Commands: builddep Install build dependencies for package or spec file changelog Show changelog data of packages config-manager manage dnf configuration options and repositories copr Interact with Copr repositories. debug-dump dump information about installed rpm packages to file debug-restore restore packages recorded in debug-dump file debuginfo-install install debuginfo packages download Download package to current directory groups-manager create and edit groups metadata file kpatch Toggles automatic installation of kpatch-patch packages needs-restarting determine updated binaries that need restarting offline-distrosync Prepare offline distrosync of the system offline-upgrade Prepare offline upgrade of the system playground Interact with Playground repository. repoclosure Display a list of unresolved dependencies for repositories repodiff List differences between two sets of repositories repograph Output a full package dependency graph in dot format repomanage Manage a directory of rpm packages reposync download all packages from remote repo system-upgrade Prepare system for upgrade to a new release General DNF options: -c [config file], --config [config file] config file location -q, --quiet quiet operation -v, --verbose verbose operation --version show DNF version and exit --installroot [path] set install root --nodocs do not install documentations --noplugins disable all plugins --enableplugin [plugin] enable plugins by name --disableplugin [plugin] disable plugins by name --releasever RELEASEVER override the value of $releasever in config and repo files --setopt SETOPTS set arbitrary config and repo options --skip-broken resolve depsolve problems by skipping packages -h, --help, --help-cmd show command help --allowerasing allow erasing of installed packages to resolve dependencies -b, --best try the best available package versions in transactions. --nobest do not limit the transaction to the best candidate -C, --cacheonly run entirely from system cache, don't update cache -R [minutes], --randomwait [minutes] maximum command wait time -d [debug level], --debuglevel [debug level] debugging output level --debugsolver dumps detailed solving results into files --showduplicates show duplicates, in repos, in list/search commands -e ERRORLEVEL, --errorlevel ERRORLEVEL error output level --obsoletes enables dnf's obsoletes processing logic for upgrade or display capabilities that the package obsoletes for info, list and repoquery --rpmverbosity [debug level name] debugging output level for rpm -y, --assumeyes automatically answer yes for all questions --assumeno automatically answer no for all questions --enablerepo [repo] Enable additional repositories. List option. Supports globs, can be specified multiple times. --disablerepo [repo] Disable repositories. List option. Supports globs, can be specified multiple times. --repo [repo], --repoid [repo] enable just specific repositories by an id or a glob, can be specified multiple times --enable enable repos with config-manager command (automatically saves) --disable disable repos with config-manager command (automatically saves) -x [package], --exclude [package], --excludepkgs [package] exclude packages by name or glob --disableexcludes [repo], --disableexcludepkgs [repo] disable excludepkgs --repofrompath [repo,path] label and path to an additional repository to use (same path as in a baseurl), can be specified multiple times. --noautoremove disable removal of dependencies that are no longer used --nogpgcheck disable gpg signature checking (if RPM policy allows) --color COLOR control whether color is used --refresh set metadata as expired before running the command -4 resolve to IPv4 addresses only -6 resolve to IPv6 addresses only --destdir DESTDIR, --downloaddir DESTDIR set directory to copy packages to --downloadonly only download packages --comment COMMENT add a comment to transaction --bugfix Include bugfix relevant packages, in updates --enhancement Include enhancement relevant packages, in updates --newpackage Include newpackage relevant packages, in updates --security Include security relevant packages, in updates --advisory ADVISORY, --advisories ADVISORY Include packages needed to fix the given advisory, in updates --bz BUGZILLA, --bzs BUGZILLA Include packages needed to fix the given BZ, in updates --cve CVES, --cves CVES Include packages needed to fix the given CVE, in updates --sec-severity {Critical,Important,Moderate,Low}, --secseverity {Critical,Important,Moderate,Low} Include security relevant packages matching the severity, in updates --forcearch ARCH Force the use of an architecture [root@iZgfrv9gike8qaZ ~]# sudo dnf remove docker \ > docker-client \ > docker-client-latest \ > docker-common \ > docker-latest \ > docker-latest-logrotate \ > docker-logrotate \ > docker-engine No match for argument: docker No match for argument: docker-client No match for argument: docker-client-latest No match for argument: docker-common No match for argument: docker-latest No match for argument: docker-latest-logrotate No match for argument: docker-logrotate No match for argument: docker-engine No packages marked for removal. Dependencies resolved. Nothing to do. Complete! [root@iZgfrv9gike8qaZ ~]# sudo dnf -y install dnf-plugins-core Last metadata expiration check: 0:57:17 ago on Mon 21 Apr 2025 09:17:14 PM CST. Package dnf-plugins-core-4.0.21-19.an8.noarch is already installed. Dependencies resolved. ============================================================================================================================================== Package Architecture Version Repository Size ============================================================================================================================================== Upgrading: dnf-plugins-core noarch 4.0.21-25.an8 BaseOS 75 k python3-dnf-plugin-post-transaction-actions noarch 4.0.21-25.an8 BaseOS 57 k python3-dnf-plugins-core noarch 4.0.21-25.an8 BaseOS 262 k Transaction Summary ============================================================================================================================================== Upgrade 3 Packages Total download size: 394 k Downloading Packages: (1/3): python3-dnf-plugin-post-transaction-actions-4.0.21-25.an8.noarch.rpm 638 kB/s | 57 kB 00:00 (2/3): dnf-plugins-core-4.0.21-25.an8.noarch.rpm 559 kB/s | 75 kB 00:00 (3/3): python3-dnf-plugins-core-4.0.21-25.an8.noarch.rpm 1.9 MB/s | 262 kB 00:00 ---------------------------------------------------------------------------------------------------------------------------------------------- Total 2.7 MB/s | 394 kB 00:00 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Running scriptlet: python3-dnf-plugins-core-4.0.21-25.an8.noarch 1/1 Upgrading : python3-dnf-plugins-core-4.0.21-25.an8.noarch 1/6 Upgrading : dnf-plugins-core-4.0.21-25.an8.noarch 2/6 Upgrading : python3-dnf-plugin-post-transaction-actions-4.0.21-25.an8.noarch 3/6 Cleanup : python3-dnf-plugin-post-transaction-actions-4.0.21-19.an8.noarch 4/6 Cleanup : dnf-plugins-core-4.0.21-19.an8.noarch 5/6 Cleanup : python3-dnf-plugins-core-4.0.21-19.an8.noarch 6/6 Running scriptlet: python3-dnf-plugins-core-4.0.21-19.an8.noarch 6/6 Verifying : dnf-plugins-core-4.0.21-25.an8.noarch 1/6 Verifying : dnf-plugins-core-4.0.21-19.an8.noarch 2/6 Verifying : python3-dnf-plugin-post-transaction-actions-4.0.21-25.an8.noarch 3/6 Verifying : python3-dnf-plugin-post-transaction-actions-4.0.21-19.an8.noarch 4/6 Verifying : python3-dnf-plugins-core-4.0.21-25.an8.noarch 5/6 Verifying : python3-dnf-plugins-core-4.0.21-19.an8.noarch 6/6 Upgraded: dnf-plugins-core-4.0.21-25.an8.noarch python3-dnf-plugin-post-transaction-actions-4.0.21-25.an8.noarch python3-dnf-plugins-core-4.0.21-25.an8.noarch Complete! [root@iZgfrv9gike8qaZ ~]# sudo dnf config-manager --add-repo \ > http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo Adding repo from: http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo [root@iZgfrv9gike8qaZ ~]# sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin Docker CE Stable - x86_64 244 kB/s | 66 kB 00:00 Dependencies resolved. ============================================================================================================================================== Package Architecture Version Repository Size ============================================================================================================================================== Installing: containerd.io x86_64 1.6.32-3.1.el8 docker-ce-stable 35 M docker-buildx-plugin x86_64 0.14.0-1.el8 docker-ce-stable 14 M docker-ce x86_64 3:26.1.3-1.el8 docker-ce-stable 27 M docker-ce-cli x86_64 1:26.1.3-1.el8 docker-ce-stable 7.8 M docker-compose-plugin x86_64 2.27.0-1.el8 docker-ce-stable 13 M Installing dependencies: container-selinux noarch 2:2.229.0-2.module+an8.9.0+11261+8fb088a9 AppStream 70 k fuse-overlayfs x86_64 1.13-1.0.1.module+an8.9.0+11261+8fb088a9 AppStream 69 k fuse3 x86_64 3.3.0-19.an8 BaseOS 54 k fuse3-libs x86_64 3.3.0-19.an8 BaseOS 95 k libcgroup x86_64 2.0-1.0.1.an8 BaseOS 78 k libslirp x86_64 4.4.0-2.module+an8.9.0+11257+d476ec85 AppStream 69 k slirp4netns x86_64 1.2.3-1.module+an8.9.0+11261+8fb088a9 AppStream 55 k Installing weak dependencies: docker-ce-rootless-extras x86_64 26.1.3-1.el8 docker-ce-stable 5.0 M Enabling module streams: container-tools an8 Transaction Summary ============================================================================================================================================== Install 13 Packages Total download size: 103 M Installed size: 390 M Is this ok [y/N]: Operation aborted. [root@iZgfrv9gike8qaZ ~]# sudo systemctl enable --now docker Failed to enable unit: Unit file docker.service does not exist. [root@iZgfrv9gike8qaZ ~]# docker --hlep -bash: docker: command not found [root@iZgfrv9gike8qaZ ~]# docker -bash: docker: command not found [root@iZgfrv9gike8qaZ ~]# dockersudo systemctl start docker -bash: dockersudo: command not found [root@iZgfrv9gike8qaZ ~]# sudo systemctl start docker Failed to start docker.service: Unit docker.service not found. [root@iZgfrv9gike8qaZ ~]# sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin Last metadata expiration check: 0:09:03 ago on Mon 21 Apr 2025 10:15:11 PM CST. Dependencies resolved. ============================================================================================================================================== Package Architecture Version Repository Size ============================================================================================================================================== Installing: containerd.io x86_64 1.6.32-3.1.el8 docker-ce-stable 35 M docker-buildx-plugin x86_64 0.14.0-1.el8 docker-ce-stable 14 M docker-ce x86_64 3:26.1.3-1.el8 docker-ce-stable 27 M docker-ce-cli x86_64 1:26.1.3-1.el8 docker-ce-stable 7.8 M docker-compose-plugin x86_64 2.27.0-1.el8 docker-ce-stable 13 M Installing dependencies: container-selinux noarch 2:2.229.0-2.module+an8.9.0+11261+8fb088a9 AppStream 70 k fuse-overlayfs x86_64 1.13-1.0.1.module+an8.9.0+11261+8fb088a9 AppStream 69 k fuse3 x86_64 3.3.0-19.an8 BaseOS 54 k fuse3-libs x86_64 3.3.0-19.an8 BaseOS 95 k libcgroup x86_64 2.0-1.0.1.an8 BaseOS 78 k libslirp x86_64 4.4.0-2.module+an8.9.0+11257+d476ec85 AppStream 69 k slirp4netns x86_64 1.2.3-1.module+an8.9.0+11261+8fb088a9 AppStream 55 k Installing weak dependencies: docker-ce-rootless-extras x86_64 26.1.3-1.el8 docker-ce-stable 5.0 M Enabling module streams: container-tools an8 Transaction Summary ============================================================================================================================================== Install 13 Packages Total download size: 103 M Installed size: 390 M Is this ok [y/N]: y Downloading Packages: (1/13): fuse-overlayfs-1.13-1.0.1.module+an8.9.0+11261+8fb088a9.x86_64.rpm 686 kB/s | 69 kB 00:00 (2/13): libslirp-4.4.0-2.module+an8.9.0+11257+d476ec85.x86_64.rpm 587 kB/s | 69 kB 00:00 (3/13): container-selinux-2.229.0-2.module+an8.9.0+11261+8fb088a9.noarch.rpm 534 kB/s | 70 kB 00:00 (4/13): slirp4netns-1.2.3-1.module+an8.9.0+11261+8fb088a9.x86_64.rpm 656 kB/s | 55 kB 00:00 (5/13): fuse3-libs-3.3.0-19.an8.x86_64.rpm 1.0 MB/s | 95 kB 00:00 (6/13): fuse3-3.3.0-19.an8.x86_64.rpm 390 kB/s | 54 kB 00:00 (7/13): libcgroup-2.0-1.0.1.an8.x86_64.rpm 894 kB/s | 78 kB 00:00 (8/13): docker-buildx-plugin-0.14.0-1.el8.x86_64.rpm 4.4 MB/s | 14 MB 00:03 (9/13): docker-ce-26.1.3-1.el8.x86_64.rpm 5.5 MB/s | 27 MB 00:04 (10/13): docker-ce-cli-26.1.3-1.el8.x86_64.rpm 3.4 MB/s | 7.8 MB 00:02 (11/13): docker-ce-rootless-extras-26.1.3-1.el8.x86_64.rpm 4.5 MB/s | 5.0 MB 00:01 (12/13): containerd.io-1.6.32-3.1.el8.x86_64.rpm 4.7 MB/s | 35 MB 00:07 (13/13): docker-compose-plugin-2.27.0-1.el8.x86_64.rpm 5.5 MB/s | 13 MB 00:02 ---------------------------------------------------------------------------------------------------------------------------------------------- Total 13 MB/s | 103 MB 00:08 Docker CE Stable - x86_64 16 kB/s | 1.6 kB 00:00 Importing GPG key 0x621E9F35: Userid : "Docker Release (CE rpm) <docker@docker.com>" Fingerprint: 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35 From : https://mirrors.aliyun.com/docker-ce/linux/centos/gpg Is this ok [y/N]: y Key imported successfully Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : docker-compose-plugin-2.27.0-1.el8.x86_64 1/13 Running scriptlet: docker-compose-plugin-2.27.0-1.el8.x86_64 1/13 Installing : fuse3-libs-3.3.0-19.an8.x86_64 2/13 Running scriptlet: fuse3-libs-3.3.0-19.an8.x86_64 2/13 Running scriptlet: container-selinux-2:2.229.0-2.module+an8.9.0+11261+8fb088a9.noarch 3/13 Installing : container-selinux-2:2.229.0-2.module+an8.9.0+11261+8fb088a9.noarch 3/13 Running scriptlet: container-selinux-2:2.229.0-2.module+an8.9.0+11261+8fb088a9.noarch 3/13 Installing : containerd.io-1.6.32-3.1.el8.x86_64 4/13 Running scriptlet: containerd.io-1.6.32-3.1.el8.x86_64 4/13 Installing : fuse3-3.3.0-19.an8.x86_64 5/13 Installing : fuse-overlayfs-1.13-1.0.1.module+an8.9.0+11261+8fb088a9.x86_64 6/13 Running scriptlet: fuse-overlayfs-1.13-1.0.1.module+an8.9.0+11261+8fb088a9.x86_64 6/13 Installing : docker-buildx-plugin-0.14.0-1.el8.x86_64 7/13 Running scriptlet: docker-buildx-plugin-0.14.0-1.el8.x86_64 7/13 Installing : docker-ce-cli-1:26.1.3-1.el8.x86_64 8/13 Running scriptlet: docker-ce-cli-1:26.1.3-1.el8.x86_64 8/13 Installing : libcgroup-2.0-1.0.1.an8.x86_64 9/13 Installing : libslirp-4.4.0-2.module+an8.9.0+11257+d476ec85.x86_64 10/13 Installing : slirp4netns-1.2.3-1.module+an8.9.0+11261+8fb088a9.x86_64 11/13 Installing : docker-ce-rootless-extras-26.1.3-1.el8.x86_64 12/13 Running scriptlet: docker-ce-rootless-extras-26.1.3-1.el8.x86_64 12/13 Installing : docker-ce-3:26.1.3-1.el8.x86_64 13/13 Running scriptlet: docker-ce-3:26.1.3-1.el8.x86_64 13/13 Running scriptlet: container-selinux-2:2.229.0-2.module+an8.9.0+11261+8fb088a9.noarch 13/13 Running scriptlet: docker-ce-3:26.1.3-1.el8.x86_64 13/13 Verifying : container-selinux-2:2.229.0-2.module+an8.9.0+11261+8fb088a9.noarch 1/13 Verifying : fuse-overlayfs-1.13-1.0.1.module+an8.9.0+11261+8fb088a9.x86_64 2/13 Verifying : libslirp-4.4.0-2.module+an8.9.0+11257+d476ec85.x86_64 3/13 Verifying : slirp4netns-1.2.3-1.module+an8.9.0+11261+8fb088a9.x86_64 4/13 Verifying : fuse3-3.3.0-19.an8.x86_64 5/13 Verifying : fuse3-libs-3.3.0-19.an8.x86_64 6/13 Verifying : libcgroup-2.0-1.0.1.an8.x86_64 7/13 Verifying : containerd.io-1.6.32-3.1.el8.x86_64 8/13 Verifying : docker-buildx-plugin-0.14.0-1.el8.x86_64 9/13 Verifying : docker-ce-3:26.1.3-1.el8.x86_64 10/13 Verifying : docker-ce-cli-1:26.1.3-1.el8.x86_64 11/13 Verifying : docker-ce-rootless-extras-26.1.3-1.el8.x86_64 12/13 Verifying : docker-compose-plugin-2.27.0-1.el8.x86_64 13/13 Installed: container-selinux-2:2.229.0-2.module+an8.9.0+11261+8fb088a9.noarch containerd.io-1.6.32-3.1.el8.x86_64 docker-buildx-plugin-0.14.0-1.el8.x86_64 docker-ce-3:26.1.3-1.el8.x86_64 docker-ce-cli-1:26.1.3-1.el8.x86_64 docker-ce-rootless-extras-26.1.3-1.el8.x86_64 docker-compose-plugin-2.27.0-1.el8.x86_64 fuse-overlayfs-1.13-1.0.1.module+an8.9.0+11261+8fb088a9.x86_64 fuse3-3.3.0-19.an8.x86_64 fuse3-libs-3.3.0-19.an8.x86_64 libcgroup-2.0-1.0.1.an8.x86_64 libslirp-4.4.0-2.module+an8.9.0+11257+d476ec85.x86_64 slirp4netns-1.2.3-1.module+an8.9.0+11261+8fb088a9.x86_64 Complete! [root@iZgfrv9gike8qaZ ~]# ls /etc/systemd/system/docker.service ls: cannot access '/etc/systemd/system/docker.service': No such file or directory [root@iZgfrv9gike8qaZ ~]# whereis docker docker: /usr/bin/docker /etc/docker /usr/libexec/docker /usr/share/man/man1/docker.1.gz [root@iZgfrv9gike8qaZ ~]# sudo systemctl enable --now docker Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service. [root@iZgfrv9gike8qaZ ~]# docker --version Docker version 26.1.3, build b72abbb [root@iZgfrv9gike8qaZ ~]# docker --help Usage: docker [OPTIONS] COMMAND A self-sufficient runtime for containers Common Commands: run Create and run a new container from an image exec Execute a command in a running container ps List containers build Build an image from a Dockerfile pull Download an image from a registry push Upload an image to a registry images List images login Log in to a registry logout Log out from a registry search Search Docker Hub for images version Show the Docker version information info Display system-wide information Management Commands: builder Manage builds buildx* Docker Buildx compose* Docker Compose container Manage containers context Manage contexts image Manage images manifest Manage Docker image manifests and manifest lists network Manage networks plugin Manage plugins system Manage Docker trust Manage trust on Docker images volume Manage volumes Swarm Commands: swarm Manage Swarm Commands: attach Attach local standard input, output, and error streams to a running container commit Create a new image from a container's changes cp Copy files/folders between a container and the local filesystem create Create a new container diff Inspect changes to files or directories on a container's filesystem events Get real time events from the server export Export a container's filesystem as a tar archive history Show the history of an image import Import the contents from a tarball to create a filesystem image inspect Return low-level information on Docker objects kill Kill one or more running containers load Load an image from a tar archive or STDIN logs Fetch the logs of a container pause Pause all processes within one or more containers port List port mappings or a specific mapping for the container rename Rename a container restart Restart one or more containers rm Remove one or more containers rmi Remove one or more images save Save one or more images to a tar archive (streamed to STDOUT by default) start Start one or more stopped containers stats Display a live stream of container(s) resource usage statistics stop Stop one or more running containers tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE top Display the running processes of a container unpause Unpause all processes within one or more containers update Update configuration of one or more containers wait Block until one or more containers stop, then print their exit codes Global Options: --config string Location of client config files (default "/root/.docker") -c, --context string Name of the context to use to connect to the daemon (overrides DOCKER_HOST env var and default context set with "docker context use") -D, --debug Enable debug mode -H, --host list Daemon socket to connect to -l, --log-level string Set the logging level ("debug", "info", "warn", "error", "fatal") (default "info") --tls Use TLS; implied by --tlsverify --tlscacert string Trust certs signed only by this CA (default "/root/.docker/ca.pem") --tlscert string Path to TLS certificate file (default "/root/.docker/cert.pem") --tlskey string Path to TLS key file (default "/root/.docker/key.pem") --tlsverify Use TLS and verify the remote -v, --version Print version information and quit Run 'docker COMMAND --help' for more information on a command. For more help on how to use Docker, head to https://docs.docker.com/go/guides/ [root@iZgfrv9gike8qaZ ~]#
|
|

浙公网安备 33010602011771号