笔者这里是用CnetOS6.5系统
开始安装daoker之旅:[root@localhost ~]# uname -r2.6.32-431.el6.x86_64[root@localhost ~]# cat /etc/issueCentOS release 6.5 (Final)Kernel \r on an \m
注意其他的源可能导致你的内核和docker的版本不一致,需要升级内核至3.x。安装:
[root@localhost ~]# rpm -ivh Retrieving warning: /var/tmp/rpm-tmp.JN76fI: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEYPreparing… ########################################### [100%] 1:epel-release ########################################### [100%][root@localhost ~]# rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
[root@localhost ~]# yum -y install docker-io
启动并设置开机自动启动
[root@localhost ~]# service docker startStarting cgconfig service: [确定]Starting docker: [确定][root@localhost ~]# chkconfig docker on
获取cnetos镜像
[root@localhost ~]# docker pull centos:latestcentos:latest: The image you are pulling has been verified511136ea3c5a: Pull complete 5b12ef8fd570: Pull complete 34943839435d: Downloading [===> ] 18.38 MB/232.5 MB 1h7m49s
#官方安装方式docker pull imagename从docker的索引中心下载,imagename是镜像名称,例如docker pull Ubuntu就是下载base ubuntu并且tag是latest。
我们还可以搜索基于 Fedora 和 Ubuntu 操作系统的容器。
[root@localhost ~]# docker search ubuntu[root@localhost ~]# docker search fedora
查看docker镜像[root@localhost ~]# docker images centosREPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZEcentos latest 34943839435d Less than a second ago 224 MB
运行docker运行shell[root@localhost ~]# docker run -i -t centos /bin/bash[root@2ce733141ece /]# [root@2ce733141ece /]# [root@2ce733141ece /]# [root@2ce733141ece /]#
停止容器
[root@localhost ~]# docker stop <CONTAINER ID>
删除所有容器
docker rm $(docker ps -a -q)
查看docker的子命令,直接敲docker 或完整的docker help 就可以 常用命令
总结一下常用命令:
其中<>阔起来的参数为必选,[]阔起来为可选
CentOS 6/7系列安装Docker
Docker的搭建Gitlab CI 全过程详解
Docker安装应用(CentOS 6.5_x64)
在 Docker 中使用 MySQL
在Ubuntu Trusty 14.04 (LTS) (64-bit)安装Docker
Docker安装应用(CentOS 6.5_x64)
Ubuntu 14.04安装Docker
阿里云CentOS 6.5 模板上安装 Docker
Docker 的详细介绍:请点这里Docker 的下载地址:请点这里
本文永久更新链接地址:
,人生的小河,总要流过森林,荒漠,