一 安装Docker前提条件
目前,CentOS仅发行版本中的内核支持Docker。
Docker运行在CentOS 7上,要求系统为64位、系统内核版本为 3.10 以上。
二 查看CentOS环境信息
[root@localhost ~]# uname -r
3.10.0-327.36.3.el7.x86_64
[root@localhost ~]#
三 安装Docker
Docker软件包和依赖包已经包含在默认的 CentOS-Extras软件源里,安装命令如下:
[root@localhost ~]# yum -y install docker
Loaded plugins: fastestmirror, langpacks
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/4): base/7/x86_64/group_gz | 155 kB 00:00:00
(2/4): extras/7/x86_64/primary_db | 139 kB 00:00:00
(3/4): updates/7/x86_64/primary_db | 3.8 MB 00:00:07
(4/4): base/7/x86_64/primary_db | 5.6 MB 00:00:07
Loading mirror speeds from cached hostfile
* base: mirrors.sohu.com
* extras: mirrors.sohu.com
* updates: mirrors.sohu.com
Resolving Dependencies
--> Running transaction check
---> Package docker.x86_64 2:1.12.6-11.el7.centos will be installed
--> Processing Dependency: docker-common = 2:1.12.6-11.el7.centos for package: 2:docker-1.12.6-11.el7.centos.x86_64
--> Processing Dependency: docker-client = 2:1.12.6-11.el7.centos for package: 2:docker-1.12.6-11.el7.centos.x86_64
--> Processing Dependency: oci-systemd-hook >= 1:0.1.4-9 for package: 2:docker-1.12.6-11.el7.centos.x86_64
--> Processing Dependency: oci-register-machine >= 1:0-1.11 for package: 2:docker-1.12.6-11.el7.centos.x86_64
--> Processing Dependency: container-selinux >= 2:2.9-4 for package: 2:docker-1.12.6-11.el7.centos.x86_64
--> Processing Dependency: skopeo-containers for package: 2:docker-1.12.6-11.el7.centos.x86_64
--> Running transaction check
---> Package container-selinux.noarch 2:2.9-4.el7 will be installed
---> Package docker-client.x86_64 2:1.12.6-11.el7.centos will be installed
---> Package docker-common.x86_64 2:1.12.6-11.el7.centos will be installed
---> Package oci-register-machine.x86_64 1:0-1.11.gitdd0daef.el7 will be installed
---> Package oci-systemd-hook.x86_64 1:0.1.4-9.git671c428.el7 will be installed
---> Package skopeo-containers.x86_64 1:0.1.18-1.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
====================================================================================================================================
Package Arch Version Repository Size
====================================================================================================================================
Installing:
docker x86_64 2:1.12.6-11.el7.centos extras 20 M
Installing for dependencies:
container-selinux noarch 2:2.9-4.el7 extras 26 k
docker-client x86_64 2:1.12.6-11.el7.centos extras 4.4 M
docker-common x86_64 2:1.12.6-11.el7.centos extras 71 k
oci-register-machine x86_64 1:0-1.11.gitdd0daef.el7 extras 1.1 M
oci-systemd-hook x86_64 1:0.1.4-9.git671c428.el7 extras 29 k
skopeo-containers x86_64 1:0.1.18-1.el7 extras 7.6 k
Transaction Summary
====================================================================================================================================
Install 1 Package (+6 Dependent packages)
Total download size: 26 M
Installed size: 104 M
Downloading packages:
(1/7): container-selinux-2.9-4.el7.noarch.rpm | 26 kB 00:00:01
(2/7): oci-systemd-hook-0.1.4-9.git671c428.el7.x86_64.rpm | 29 kB 00:00:00
(3/7): skopeo-containers-0.1.18-1.el7.x86_64.rpm | 7.6 kB 00:00:00
(4/7): docker-client-1.12.6-11.el7.centos.x86_64.rpm | 4.4 MB 00:00:03
(5/7): docker-1.12.6-11.el7.centos.x86_64.rpm | 20 MB 00:00:06
(6/7): docker-common-1.12.6-11.el7.centos.x86_64.rpm | 71 kB 00:00:07
(7/7): oci-register-machine-0-1.11.gitdd0daef.el7.x86_64.rpm | 1.1 MB 00:00:08
------------------------------------------------------------------------------------------------------------------------------------
Total 3.1 MB/s | 26 MB 00:00:08
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 2:docker-common-1.12.6-11.el7.centos.x86_64 1/7
Installing : 2:docker-client-1.12.6-11.el7.centos.x86_64 2/7
Installing : 1:oci-systemd-hook-0.1.4-9.git671c428.el7.x86_64 3/7
Installing : 1:oci-register-machine-0-1.11.gitdd0daef.el7.x86_64 4/7
Installing : 1:skopeo-containers-0.1.18-1.el7.x86_64 5/7
Installing : 2:container-selinux-2.9-4.el7.noarch 6/7
setsebool: SELinux is disabled.
/usr/sbin/semodule: invalid option -- 'X'
Installing : 2:docker-1.12.6-11.el7.centos.x86_64 7/7
Verifying : 2:container-selinux-2.9-4.el7.noarch 1/7
Verifying : 2:docker-1.12.6-11.el7.centos.x86_64 2/7
Verifying : 1:skopeo-containers-0.1.18-1.el7.x86_64 3/7
Verifying : 1:oci-register-machine-0-1.11.gitdd0daef.el7.x86_64 4/7
Verifying : 2:docker-common-1.12.6-11.el7.centos.x86_64 5/7
Verifying : 2:docker-client-1.12.6-11.el7.centos.x86_64 6/7
Verifying : 1:oci-systemd-hook-0.1.4-9.git671c428.el7.x86_64 7/7
Installed:
docker.x86_64 2:1.12.6-11.el7.centos
Dependency Installed:
container-selinux.noarch 2:2.9-4.el7 docker-client.x86_64 2:1.12.6-11.el7.centos
docker-common.x86_64 2:1.12.6-11.el7.centos oci-register-machine.x86_64 1:0-1.11.gitdd0daef.el7
oci-systemd-hook.x86_64 1:0.1.4-9.git671c428.el7 skopeo-containers.x86_64 1:0.1.18-1.el7
Complete!
四 启动Docker后台服务
[root@localhost ~]# service docker start
五 测试运行 hello-world
由于本地没有hello-world这个镜像,所以会下载一个hello-world的镜像,并在容器内运行。
[root@localhost ~]# docker run hello-world
Unable to find image 'hello-world:latest' locally
Trying to pull repository docker.io/library/hello-world ...
latest: Pulling from docker.io/library/hello-world
78445dd45222: Pull complete
Digest: sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://cloud.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/
相关推荐
CentOS下Docker 安装及使用教程,帮助Docker初学的同学们快速入门 主要内容:使用 yum 安装 Docker、镜像加速
官网的docker的离线安装包,直接rpm 安装即可使用。Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化。
CentOS6.7 Docker最小版镜像 最小版的CentOS6.7,安装了openssh、wget、vim、target,用户名:root/root
在本文中,我们将深入探讨如何在CentOS 7.4上进行Docker的离线安装。这个过程对于那些没有互联网连接或者网络环境受限的服务器尤其重要。我们将使用RPM软件包来完成安装,并且会参考提供的附件“CentOS7.4离线安装...
Docker 安装 Oracle11g(CentOs)
安装步骤参考:https://blog.csdn.net/chkai123/article/details/126229727 docker离线安装 arm架构下离线安装docker docker centos7离线安装docekr 离线安装docker arm架构下安装docker arm架构centos7安装docker
CentOS7 Docker防火墙的简单配置 禁用 firewalld 服务 systemctl disable firewalld systemctl stop firewalld 安装 iptables 防火墙服务 yum install iptables-services 创建 iptables 配置脚本 cat >> /usr/...
Centos 6.9安装docker步骤,同步部署。自己整理容器实用。
这个我亲手写的docker入门教程,适合入门者,欢迎下载。
CentOS 7.3 docker 离线安装方法(亲测) 1、配置网卡: vi /etc/sysconfig/network-scripts/ifcfg-ens33 ONBOOT=yes 2、安装dep 软件包docker.tgz tar -zxf docker.tgz 3、修改配置(加=false) vi /etc/...
在基础镜像centos7.5的基础上,增加了vim,net-tools命令,及libnpg,gtk2系统库。
主要介绍了centos 下docker 安装方法,本文只介绍比较简易的安装方式,需要的朋友可以参考下
离线安装Docker在没有网络的环境中至关重要,这个CentOS下的Docker 1.13.1离线rpm包为此提供了方便。通过了解其特性并按照正确的步骤安装,即使在不联网的情况下,用户也能充分利用Docker的强大功能。
### CentOS7下Docker桥接网络配置详解 #### 一、背景介绍 Docker作为一种流行的容器化技术,为开发者提供了轻量级、可移植的容器环境。为了更好地管理容器之间的网络通信,理解Docker在网络配置方面的机制至关重要...
离线环境下,在centos7.6系统上安装docker-ce-19.03,nvidia-docker2.4版本,其中docker-ce-19.03在docker-local.tar压缩文件里面,nvidia-docker2在nvidia-docker2.zip文件中。 具体安装流程如下: 1.安装docker ...
CentOS6离线安装docker1.7,以及相关的依赖架包,包括docker-io-1.7.1-2.el6.x86_64.rpm、lxc-libs-1.0.11-1.el6.x86_64.rpm、lxc-1.0.11-1.el6.x86_64.rpm等以及device-mapper-1.02.117-12.el6_9.1.x86_64.rpm、...
3、docker和docker-compose安装要提前安装完成 4、将下载内容解压一个目录 5、运行 docker-compose up # 此命令环境会在终端前台运行 docker-compose up -d # 加上-d会放入后台进行环境的启动 如有问题,欢迎进行...
在本文中,我们将深入探讨如何在CentOS 7.3环境下离线安装Docker CE (Community Edition) 版本17.06.0-ce。Docker作为一个流行的容器化平台,使得开发者能够轻松地构建、分发和运行应用程序。在没有网络连接的情况下...
在本文中,我们将深入探讨如何在CentOS 6.8系统上离线安装Docker环境,这主要依赖于RPM(Red Hat Package Manager)包。RPM是Linux发行版如CentOS用来安装、升级和管理软件的主要方式。由于是离线安装,我们需要预先...
解压上传到服务器 安装docker sh install.sh docker-18.03.1-ce.tgz 卸载docker sh uninstall.sh 安装docker-compose sh docker-compose.sh docker-compose-Linux-x86_64 如有不明白的欢迎随时咨询