文件名称:
Linux环境基于CentOS7 搭建部署Docker容器.pdf
开发工具:
文件大小: 679kb
下载次数: 0
上传时间: 2019-08-30
详细说明:Linux环境基于CentOS7 搭建部署Docker容器Docker容器部署
查看 Centos7开发环境:cat/etc/ centos- release
[rootcentos-amber# cat/etc/'centos-release
CentOS Linux release 7.6. 1810(Core)
Lrootacentos-amber#
查看 Centos7内核版本: uname-a或者cat/ proc/version
rootcentos-amber# unamc-a
inux centos-amber 3. 10.0-957. 27. 2. e17. x86 64#1 SMP Mon Jul 29 17: 46: 05 UTC
2019x8664x8664x8664GNU/ Linux
Lrootacentos amber]#
在增加 Docker阿里云yum源之前需要执行基砒组件安装以及卸载历史版本
基础组件安装: yum-y install gcc&yum- y install gcc-C++
#gcc环境安装
yum -y install gcc
y install
gCc-c++
卸载历史版本: yum-y remove docker docker- common docker -selinux docker
engine
[rootcentos-amber ] yum -y remove docker docker-common docker-selinux
docker-engine
Loaded plugins: fastestmirror
No Match for argument: docker
No Match for argument: docker common
No Match for argument: docker-selinux
No Match for argument: docker-engine
No Packages marked for removal
TrootOcentos-amber#
或者删除已安装的 Docker
Uninstall installed docker
Lrootacentos-amber# sudo yum remove docker
docker-client
docker-client-latest
docker-common
docker-latest
docker-latest-logrotate
docker-logrotate
docker-selinux
docker-engine-selinux
docker-engine
Loaded plugins: fastestmirror
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 -selinux
No Match for argument: docker-engine-selinux
No Match for argument: docker-engine
No Packages marked for removal
[centos-amber#
Ps: Docker署要求64位的系统且内核版本至少为10
2.0.2部署 Docker添加yum源: yum install epel-release -y&& yum list
[rootcentos -amber]# yum install epel-release -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Package epel-release-7-1l noarch already installed and latest version
Nothing to do
[rootcentos amber#
[rootcentos - amber# yum clean al
Loaded plugins: fastestmirror
Cleaning repos: base epel extras updates
Cleaning up list of fastest mirrors
Root centos- amber」井yum1i
2.1 Docker容器安装
配置阿里云 Docker yun源
[1] Set up repository
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
[rootcentos-amber docker]# sudo yum install -y yum-utils device-mapper
persistent-data lvm2
[rootcentos -amber docker]#
[2] Use Aliyun Docker
sudoyum-config-manager--add-repohttp://mirrors.aliyun.com/docker
ce/linux/centos/docker-ce repo
[rootcentos-amber docker]# sudo yum-config-manager --add-repo
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
Loaded plugins fastestmirror
addingrepofromhttp://mirrors.aliyun.com/docker-ce/linux/centos/docker
ce. repo
grabbingfilehttp://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
to /etc/yum. repos. d /docker-ce repo
repo saved to /etc/yum. repos. d /docker-ce repo
Trootcentos amber docker#
更新Yum缓存: sudo yum -y makecache fast
[rootcentos-amber]# sudo yum makecache fast
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
ase
3.6kB00:00:00
docker-ce-stable
3.5kB00:00:00
epe
5.3kB00:00:00
extras
3.4kB00:00:00
updates
13.4kB00:00:00
(1/2): docker-ce-stable/ x86 64/updateinfo
55B00:00:00
(2/2): docker-ce-stable/ x86 64/ primary db
32kB00:00:00
Metadata cache created
[rootcentos-amber# sudo yum -y makecache fast
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
ase
13.6kB00:00:00
docker-ce-stable
13.5kB00:00:00
ep
15.3kB00:00:00
extras
13.4kB00:00:00
updates
3.4kB00:00:00
Metadata Cache Created
Trootcentos-amber#
查看对应版本: yum list docker-ce-- showduplicates
rootcentos-amber docker]# yum list docker-ce--showduplicates
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
docker-ce-stable
3.5kB00:00:00
(1/2): docker-ce-stable/x86 64/updatcinfc
55B00:00:00
(2/2): docker-ce-stable/ x86 64/primary db
32kB00:00:00
Available Packages
docker-ce x86 64
17.03.0.cc-1.c17. centos
docker-ce-stable
locker-ce. x
17.03.1.ce-1.e17. centos
docker-ce-stable
docker-ce x86 64
17.03.2.ce-1.c17. centos
docker-ce-stable
ocker-ce. xU
17.03.3.ce-1.el7
docker-ce-stabli
docker-ce x86 64
17.06.0.ce-1.c17. centos
docker-ce-stable
docke
8664
17.06.1.ce-1.e17. centos
docker-ce-stable
docker-ce x86 64
17.06.2.ce-1.e17.cent
docker-ce-stable
docker-ce x86 64
17.09.0.ce-1.e17. centos
docker-ce-stable
docker-ce x86 64
17.09.1.ce-1.e17. centos
docker-ce-stable
docker-ce x86 64
17.12.0.ce-1.e17.cent
docker-ce-stable
docker-ce x86 64
17.12.1
1. el7. centos
docker-ce-stablo
docker-ce x86 64
18.03.0.ce-1.e17.ce
docker-ce-stable
docker-ce x86 64
18.03.1.ce-1.e17. cento
docker-ce-stable
docke
x8664
18.06.0.ce-3.el7
docker-ce-stable
docker-ce X86 64
18.06.1.ce-3.e17
docker-ce-stabl
docker-ce x86 64
18.06.2.ce-3.e17
docker-ce-stable
docker-ce x86 64
18.06.3.ce-3.e17
docker-ce-stabl
docker-ce x86 64
3:18.09.0-3.e17
docker-ce-stable
docker-ce x86 64
3:18.09.1-3.e17
docker-ce-stable
docker-ce x86 64
3:18.09.2-3.e17
docker-ce-stable
docker-ce x86 64
3:18.09.3-3.e17
docker-ce-stabl
docker-ce X86 64
3:18.09.4-3.e17
docker-ce-stabl
docker-ce x86 64
3:18.09.53.e17
docker-ce-stabl
docker-ce x86 64
3:18.09.6-3.e17
docker-ce-stable
docker-ce x86 64
3:18.09.7-3.e17
docker-ce-stable
docker-ce X86 64
docker-ce-stablo
docker-ce x86 64
3:19.03.0-3.e17
docker-ce-stable
docker-ce X86 64
19.03.1-3.e17
docker-ce-stable
[rootcentos-amber docker#
213安装 Docker最新版本: sudo yum install docker-ce
docker-ce-Cl或者 yum install docker-io-y
[rootcentos-amber docker]# sudo yum install dockor-cc
Installed
docker-ce.x86643:19.03.1-3.e17
Dependency Installed:
audit-libs-python X86 640: 2.8. 4-4. el7 checkpolicy x86 640: 2.5-8e17
container-sclinux, noarch 2: 2.107-1cl7 6
container. io x86 64
0:1.2.6-3.3.e17 docker-ce-cli.x86641:19.03.1-3.el7
libcgroup.x86640:0.41-20.e17
bsemanage-py thon x86 640: 2.5
14. e17 policycoreutils-python. x86 640: 2.5-29.el7 6. 1 python-IPy noarch
0:0.75-6.e17
setools-libs x86 640: 3.3.8-4.el7
amber docker]#
2.14启动 Docker服务:
Start docker service
systemctl enable docker
systemctI start docker
执行: systemctl enable docker允许开机启动
[rootcentos-amber docker]# systemctl enable docker
Created symlink from /etc/systemd/system/multi
user.target wants/ docker. service to /usr/lib/ systemd/ system/docker. service
Trootacentos-amber docker]#
执行: systemctl start docker启动 Docke服务
Rootcentos-amber docker]# systemctl start docker
Lrootacentos-amber docker
基本命令
systemctl enable docker#允许开机启动
systemctl start docker#运行 Docker守护进程
systemctl stop docker#停止 Docker守护进程
systemctl restart docker#重启 Docker守护进程
systemctl status docker#查看 Docke的运行状态
2.1.5检验安装 Docker服务信息:
执行: docker info查看 Docker服务信息
LrootGcentos-amber docker docker info
Client:
Debug Mode: false
Server
Containers: 0
Running
ause
Stopped: 0
Images: 0
Server version:19.03. 1
Storage Driver: overlay 2
Backing Filesystem: etfs
Supports d type: true
Native Overlay Diff: true
Logging driver: json-file
Cgroup driver
Plugins
Volume: local
Network: bridge host ipv lan macv lan null overlay
og: awslogs fluent gcplogs gelf journald json-file local logentries
splunk syslog
Swarm: inactive
Runtimes: runc
De fault runt ime: runc
Init B
container version: 894b81a4b802e4eb2a91dIce216b8817763c29fb
runc version: 425e105d5a03fabd737a126ad93d62a9eeede87f
t version fec 3683
Security options:
secco
p
Profile: default
Kernel version:3.10.0-957.27.2.e17.x8664
ting system centOS L
OSType: linux
chitecture x86 64
CPUS: 1
Total me
795GiB
centos-amber
ID: TS7V: P2HE: MICX: JPNT: H5JU: PQX5: JWB3: 4YS0: DM7X: RVBV: URME 64DZ
Docker Root Dir:/var/lib/docker
Debug Mode: false
Registryhttps://index.dockerio/v1/
Labels
Experimental: false
Insecure Registries
127.0.0.0/8
Live restore enabled false
Lrootacentos-amber docker#
执行: docker version查看版本号
Irootacentos-amber docker docker version
Client: Docker Engine-Communit
Version
19.03.1
API version
1.40
Go version
g
Git commit
74b1e89
Built
Thu Jul2521:21:072019
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.