[TimLinux] docker CentOS7安装docker-ce最新版
1. 环境
$ lsb_release -a # 需要安装 redhat-lsb-core 包
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.5. (Core)
Release: 7.5.
Codename: Core
2. 安装docker-ce
. 移除旧版本:
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-selinux \
docker-engine-selinux \
docker-engine . 安装系统工具
yum install -y yum-utils device-mapper-persistent-data lvm2 . 添加软件源
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo . 更新 yum 缓存
yum makecache fast . 安装docker-ce
yum -y install docker-ce . 启动服务
systemctl enable docker.service
systemctl start docker.service
systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: active (running) since Tue 2019-02-19 14:32:54 CST; 15min ago
Docs: https://docs.docker.com
Main PID: 30656 (dockerd)
Tasks: 20
Memory: 58.1M
CGroup: /system.slice/docker.service
├─30656 /usr/bin/dockerd -H fd://
└─30660 containerd --config /var/run/docker/containerd/containerd.toml --log-level info
Feb 19 14:32:54 VM_0_7_centos dockerd[30656]: time="2019-02-19T14:32:54.562741035+08:00" level=info msg="Docker daemon" commit=62...18.09.2
Feb 19 14:32:54 VM_0_7_centos dockerd[30656]: time="2019-02-19T14:32:54.562856673+08:00" level=info msg="Daemon has completed ini...zation"
Feb 19 14:32:54 VM_0_7_centos dockerd[30656]: time="2019-02-19T14:32:54.600567389+08:00" level=info msg="API listen on /var/run/d...r.sock"
Feb 19 14:32:54 VM_0_7_centos systemd[1]: Started Docker Application Container Engine.
Feb 19 14:33:19 VM_0_7_centos dockerd[30656]: time="2019-02-19T14:33:19.281603981+08:00" level=info msg="shim containerd-shim sta...d=30841
Feb 19 14:33:19 VM_0_7_centos dockerd[30656]: time="2019-02-19T14:33:19.638873050+08:00" level=info msg="shim reaped" id=ebf4c60d...3e8f83a
Feb 19 14:33:19 VM_0_7_centos dockerd[30656]: time="2019-02-19T14:33:19.648960086+08:00" level=info msg="ignoring event" module=l...Delete"
Feb 19 14:43:24 VM_0_7_centos dockerd[30656]: time="2019-02-19T14:43:24.662160874+08:00" level=info msg="shim containerd-shim sta...d=31842
Feb 19 14:43:25 VM_0_7_centos dockerd[30656]: time="2019-02-19T14:43:25.061068379+08:00" level=info msg="shim reaped" id=f70bd83d...edcba6a
Feb 19 14:43:25 VM_0_7_centos dockerd[30656]: time="2019-02-19T14:43:25.071236528+08:00" level=info msg="ignoring event" module=l...Delete"
Hint: Some lines were ellipsized, use -l to show in full.
. 验证
docker run hello-world Hello from Docker!
This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps:
. The Docker client contacted the Docker daemon.
. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
. 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://hub.docker.com/ For more examples and ideas, visit:
https://docs.docker.com/get-started/
3. 卸载 docker-ce
yum remove docker-ce
rm -rf /var/lib/docker
4. 推荐
在安装过程中,因为要联网,我的作法是申请了一台免费的腾讯云机器,第一次注册的新用户有15天的免费试用权,希望能够完成多数docker相关任务的研究工作。更多内容请参考:中文文档:https://docs.docker-cn.com/get-started,英文文档:https://docs.docker.com/get-started
最新文章
- ( 转 ) Android自绘字体大小paint.settextsize随分辨率大小变化
- Linux守护进程实现程序只运行一次
- 我的MySQL5.6免安装版配置过程
- mysqld服务器如何查看使用变量的值
- ASP.NET中的指令:
- 论文笔记之:Fully Convolutional Attention Localization Networks: Efficient Attention Localization for Fine-Grained Recognition
- SpringBoard
- 那些年我用awk时踩过的坑——awk使用注意事项
- 初次接触VC++载入自己定义LIB 即静态链接
- javaee加密部署,tomcat使用自己的classloader解密【正解】
- 《java入门第一季》集合框架引入与面试题
- 播放器的书签--推荐使用Potplayer
- 使用.net core efcore根据数据库结构自动生成实体类
- Github page搭建博客使用自定义插件的方法
- Python循环语句之break与continue的用法
- Ubutu16.04+Cuda9.2/9.0+Cudnn7.12/7.05+TensorFlow-gpu-1.8/1.6
- Visual Studio2015安装过程以及单元测试
- iOS工程中创建pch文件
- Centos6.4下安装protobuf及简单使用
- [js常用]连续播放音频