Categories: Docker工作

Centos7上安装和使用Docker

环境:CentOS 7

Docker支持CentOS 6及以后的版本。

对于CentOS 6系统可使用EPEL库安装Docker, 命令如下:

yum install -yhttp://mirrors.yun-idc.com/epel/6/i386/epel-release-6-8.noarch.rpm

yum install -y docker-io

 
 

首先关闭selinux

[root@localhost ~]# yum install -y docker

也可以换成国内源,速度比较快.我换成阿里的.

先备份自带源,万一出错改回来

[root@localhost ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

 
 

安装完毕手动启动下

[root@localhost ~]# systemctl start docker

[root@localhost ~]# systemctl enable docker

[root@zabbix-server ~]# docker pull ubuntu ##可以在后面指定Ubuntu版本,比如docker pull ubuntu14.04

如果不指定版本号,默认下载最新的

 
 

下载完成就是运行

[root@localhost ~]# docker run -t -i ubuntu /bin/bash

查看

[root@localhost ~]# docker images

 
 

#TAG 用来标记来自同一个仓库的不同镜像,例如Ubuntu仓库有多个镜像,10.04 , 12.04,12.10

 
 

 
 

Kai

Recent Posts

ESXi精简置备盘空间回收

   家里的nuc上lab环境…

2 周 ago

Dell MD系列存储重置管理密码

正好手里有几台Dell MD3…

2 周 ago

Dell ME4存储管理口无法登录修复

这次碰到一台DELL ME40…

2 周 ago

分享个便宜速度快的云主机

野草云 https://my.…

2 月 ago

众筹微软大佬徐庭老师M365课程

 联系邮箱:gyd1#vip.…

2 月 ago

求职

 邮箱:gyd1#vip.qq…

2 月 ago