DOCKER 的安装和卸载

来源:互联网 发布:栏目包装 知乎 编辑:程序博客网 时间:2024/05/16 05:49


前提条件

Docker 需要使用Linux 中内核的CGrups 和Namespace 功能,因此必须使用
包含这两项功能的Linux 内核,所以内核必须是高于3.10 的64 位系统,可以通
过uname -r 查看当前的内核版本。


root@ghostcloud:~# uname -r
3.13.0-65-generic


Ubuntu 上面安装

Apt 是Ubuntu 默认的包管理系统,apt 在安装的时候会根据你的apt 配置文
件去搜索安装源。一

同样以root 用户登录系统,
1. 安装
root@ghostcloud:~# apt-get install docker-engine
2. 启动docker daemon
root@ghostcloud:~# service docker start
3. 测试安装是否成功
root@ghostcloud:~# docker version



CENTOS 上面的安装


yum install docker安装的不是最新的版本,

要安装最新的,可参考文档:

https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-centos-7 

简单的步骤如下


But first, let's update the package database:

  • sudo yum check-update

Now run this command. It will add the official Docker repository, download the latest version of Docker, and install it:

  • curl -fsSL https://get.docker.com/ | sh

After installation has completed, start the Docker daemon:

  • sudo systemctl start docker

Verify that it's running:

  • sudo systemctl status docker

卸载

列出你安装过的包

$ yum list installed | grep docker
yum list installed | grep docker
docker-engine.x86_64   1.7.1-1.el7 @/docker-engine-1.7.1-1.el7.x86_64.rpm

删除安装包

$ sudo yum -y remove docker-engine.x86_64

删除镜像/容器等

$ rm -rf /var/lib/docker


0 0
原创粉丝点击