Docker简介

Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化。容器是完全使用沙箱机制,相互之间不会有任何接口(类似 iPhone 的 app)。几乎没有性能开销,可以很容易地在机器和数据中心中运行。最重要的是,他们不依赖于任何语言、框架包括系统。 
前提

首先,你的Centos的系统一定要是64位的,不管版本是什么。并且内核版本至少是3.10以上。 
用以下命令去查看你的内核版本:

$ uname -r
3.10.0-229.el7.x86_64

最后,建议你更新你的系统,因为最新内核可能会修复了旧版本的一些bug。

安装

用yum安装

用具有sudo或者root权限的用户登录系统。

确保你的yum包已经更新

$ sudo yum update

添加yum仓库

$ sudo tee /etc/yum.repos.d/docker.repo <<-'EOF'
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF

安装Docker包

$ sudo yum install docker-engine
  • 开启docker deamon
$ sudo service docker start

验证docker是否成功安装

$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from hello-world
a8219747be10: Pull complete
91c95931e552: Already exists
hello-world:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.
Digest: sha256:aa03e5d0d5553b4c3473e89c8619cf79df368babd1.7.1cf5daeb82aab55838d
Status: Downloaded newer image for hello-world:latest
Hello from Docker.
This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(Assuming it was not already locally available.)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. 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 For more examples and ideas, visit:
http://docs.docker.com/userguide/

开机自启动

$ sudo chkconfig docker on

卸载

列出你安装过的包

$ 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

删除镜像/容器等

$ rum -rf /var/lib/docker

详情请参阅:官网教程

CentOS系统下docker的安装与卸载的更多相关文章

  1. Centos系统下Docker的安装

    一.检查内核版本 安装Docker,需要linux内核大于3.10 使用uname -r 来检查 二. Centos系统下Docker的安装 1. 安装需要的软件包 yum install -y yu ...

  2. 【新技术】CentOS系统下docker的安装配置及使用详解

    1 docker简介    Docker 提供了一个可以运行你的应用程序的封套(envelope),或者说容器.它原本是dotCloud 启动的一个业余项目,并在前些时候开源了.它吸引了大量的关注和讨 ...

  3. CentOS 系统下使用 yum 安装 Redis

    本文主要介绍在 CentOS 7 系统下使用 yum 安装 Redis 的过程. 更改 yum 源 将 Centos 的 yum 源更换为国内的阿里云源. 首先备份你的原镜像文件,保证出错后可以恢复: ...

  4. CentOS 7 下Docker的安装

    笔者是刚入行1年的新鸟,近期公司开始推Docker技术.这个系列的文章都是基于CentOS7系统下进行讲解的. Docker简介 Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及 ...

  5. Centos7.6系统下docker的安装

    一.环境说明 系统:CentOS7.6 软件:Docker19.03 二.Docker的安装 2.1.在线安装 (1) 设置仓库,安装所需的软件包. yum-utils 提供了 yum-config- ...

  6. CentOS 7 中 Docker 的安装和卸载

    安装Dokcer Docker 软件包已经包括在默认的 CentOS-Extras 软件源里.因此想要安装 docker,只需要运行下面的 yum 命令: [root@localhost ~]# yu ...

  7. docker入门(1) Centos 7 下docker的安装

    centos 7安装docker 什么是 Docker Docker 是一个开源项目,诞生于 2013 年初,最初是 dotCloud 公司内部的一个业余项目.它基于 Google 公司推出的 Go ...

  8. 在Centos系统下使用命令安装gnome图形界面程序

    第一步:先检查yum 是否安装了,以及网络是否有网络.如果这两者都没有,先解决网络,在解决yum的安装. 第二步:在命令行下 输入下面的命令来安装Gnome包. # yum groupinstall ...

  9. Linux Centos下软件的安装与卸载方法

    转载于: http://blog.csdn.net/zolalad/article/details/11368879 Linux下软件的安装与卸载   第一章   linux下安装软件,如何知道软件安 ...

随机推荐

  1. 使用FileZilla解决从Windows上传文件到Linux vsftpd的乱码问题!

    日前将golang的开发环境从windows转移到了CentOS6上,为了把以前写得项目代码上传到centos,架设了vsftpd服务,设置为本地用户登录,然后用惯用的ftp软件flashfxp上传了 ...

  2. 微信小程序省市区选择器对接数据库

    前言,小程序本身是带有地区选着器的(网站:https://mp.weixin.qq.com/debug/wxadoc/dev/component/picker.html),由于自己开发的程序的数据是很 ...

  3. 【转】Redis集群搭建与简单使用

    介绍安装环境与版本 用两台虚拟机模拟6个节点,一台机器3个节点,创建出3 master.3 salve 环境. redis 采用 redis-3.2.4 版本. 两台虚拟机都是 CentOS ,一台 ...

  4. mysql中如何开启binlog?开启二进制日志文件?binary log?

    需求描述: 开启mysql的binlog即binary log日志功能,在此记录下. 版本描述: mysql版本:5.7.21-log 操作过程: 1.修改my.cnf并且将以下参数加入其中,重启my ...

  5. Java实现两个变量的互换(不借助第3个变量)

    创建一个类,在该类中定义两个变量并为其指定初始值,然后交换两个变量的值,要求不允许借助第三个变量,只能使用异或运行实现两个变量值的交换. import java.util.Scanner; publi ...

  6. 8 -- 深入使用Spring -- 4... Spring的AOP

    8.4 Spring的AOP AOP(Aspect Orient Programming),也就是面向切面编程,最为面向对象编程的一种补充. AOP和OOP互为补充,面向对象编程将程序分解成各个层次的 ...

  7. MySQL--指定浮点型数据的精确度TRUNCATE

    INSERT INTO perf_week(node_id,perf_time,pm25,pm10,temp,humi) ) ) ) ) AS humi FROM perf_pm25 WEEK) AN ...

  8. 第四章 TCP粘包/拆包问题的解决之道---4.1---

    4.1 TCP粘包/拆包 TCP是一个“流”协议,所谓流,就是没有界限的一串数据.TCP底层并不了解上层业务数据的具体含义,它会根据TCP缓冲区的实际情况进行包的划分,所以在业务上认为,一个完整的包可 ...

  9. ios开发之--搜索框的使用(PYSearchViewController的使用)

    最近需要开发搜索框,比较了以前的各个版本的搜索框,UISearchDisplayController和UISearchController的使用,以后再做记录,随着ios11的更新,一些控件发生了,改 ...

  10. Linux最大打开文件描述符数

    1.    系统最大打开文件描述符数:/proc/sys/fs/file-max a.    查看 $ cat /proc/sys/fs/file-max 186405 2. 设置 a.    临时性 ...