Docker的部署安装(CentOS)-by paymob
环境准备
通过命令查看系统版本和内核版本等信息
[gmuser@--- ~]$ cat /etc/redhat-release
CentOS Linux release 7.2. (Core)
[gmuser@--- ~]$ uname -a
Linux --- 3.10.-327.18..el7.x86_64 # SMP Thu May :: UTC x86_64 x86_64 x86_64 GNU/Linux
[gmuser@--- ~]$ cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID=""
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION=""
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION=""
为用户提权(sudo)
[gmuser@--- ~]$ sudo install
[sudo] password for gmuser:
Sorry, try again. [sudo] password for gmuser:
gmuser is not in the sudoers file. This incident will be reported.
[gmuser@--- ~]$ su root Password:
[root@--- gmuser]# vim /etc/sudoers ## Allow root to run any commands anywhere root ALL=(ALL) ALL gmuser ALL=(ALL) ALL ## Allows members of the 'sys' group to run networking, software, ## service management apps and more. # %sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, DELEGATING, PROCESSES, LOCATE, DRIVERS ## Allows people in group wheel to run all commands
保存退出
操作系统需求
为兼容企业级应用,学习选用Centos7做为部署安装Docker的系统平台
更换默认的yum源
Centos默认的yun源在国外,速度很慢有时间也无法访问
[gmuser@--- ~]$ yum repolist [gmuser@--- ~]$ vi /etc/hosts [gmuser@--- ~]$ ping mirrors.aliyun.com 更换成aliyun yum 源 [root@--- /]# cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak [root@--- /]# curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo [root@--- /]# vi /etc/yum.repos.d/CentOS-Base.repo
Yum运行下面的命令生成缓存
[root@--- /]# yum clean all
Loaded plugins: fastestmirror, langpacks
Cleaning repos: base epel extras updates
Cleaning up everything
Cleaning up list of fastest mirrors
[root@--- /]# yum makecache
[root@--- /]# yum repolist
删除docker旧版本
[gmuser@--- /]$ sudo yum remove docker docker-common docker-selinux docker-engine
[sudo] password for gmuser:
Loaded plugins: fastestmirror, langpacks
No Match for argument: docker
No Match for argument: docker-common
No Match for argument: docker-selinux
No Match for argument: docker-engine
No Packages marked for removal
安装 Docker CE
[gmuser@--- /]$ sudo yum remove docker docker-common docker-selinux docker-engine
[gmuser@--- /]$ sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
[gmuser@--- /]$ sudo yum install -y docker-ce
若需要安装指定的版本时,可参照以下命令
启动docker
[gmuser@--- /]$ sudo systemctl start docker
[gmuser@--- /]$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES [gmuser@--- /]$
升级和卸载docker
使用阿里镜像加速器
使用阿里云专属加速器加快获取Docker官方镜像,否则在国内速度会慢到你无法忍受哒。步骤如下:
- 免费注册一个阿里云账号 www.aliyun.com
- 进入加速器页面 https://cr.console.aliyun.com/#/accelerator
- 选择
镜像加速器
按图中进行相关配置
参考文档:
Docker的部署安装(CentOS)-by paymob的更多相关文章
- Docker的部署安装(CentOS)
环境准备 操作系统需求 为兼容企业级应用,学习选用Centos7做为部署安装Docker的系统平台 # 通过以下命令可查看系统版本和内核版本等信息 cat /etc/redhat-release #- ...
- Devops实战(一)Docker的部署安装以及Docker-Compose的使用
Docker的部署安装以及Docker-Compose的使用 1.docker和docker-Compose简介 Docker是一组平台即服务(PaaS)产品,它们使用操作系统级虚拟化以称为容器的软件 ...
- docker运行环境安装-centos(一)
在这里我们使用的是docker的社区版Docker CE,针对的是未安装docker的新的主机,如果安装过docker的早期版本,先卸载它们及关联的依赖资源,安装的版本为docker 18.03. 1 ...
- (二)docker的部署安装,配置,基础命令
一.docker 的安装部署 这里不过多介绍,下面这两个linux发型版 安装可以参考 ubuntu的 docker-ce安装 centos7的 docker-ce安装 二.docker配置文件 重要 ...
- docker之windows安装¢OS安装
按这个安装 没什么毛病 https://blog.csdn.net/vitaair/article/details/80894890 https://www.runoob.com/docker/ce ...
- 【Docker学习之二】Docker部署安装
环境 docker-ce-19.03.1-3.el7.x86_64 一.Docker的部署安装 Docker采用Linux(内核)技术,所以只能运行在Linux上,官方说Linux kernel至少3 ...
- Docker学习笔记_04 Rancher的部署安装(编排选用K8S)
原文地址:http://dbase.cc/2018/01/12/docker/04_rancher的部署安装/ 为什么要使用Rancher Rancher是一个开源的企业级容器管理平台.通过Ranch ...
- Rancher的部署安装(编排选用K8S)
为什么要使用Rancher Rancher是一个开源的企业级容器管理平台.通过Rancher,企业再也不必自己使用一系列的开源软件去从头搭建容器服务平台.Rancher提供了在生产环境中使用的管理Do ...
- 【docker部署】基于linux的centos操作系统部署安装docker容器
一.docker介绍 容器是轻量级的,包含应用运行所需所有东西(代码.库.运行时环境.系统设置,以及依赖关系)的独立的包.每个容器都部署于它自己的 CPU.内存.块 I/O,以及网络资源上,所有这些都 ...
随机推荐
- Python笔记_第四篇_高阶编程_高阶函数_2.filter
1. filter函数: 原型:filter(fn,lsd) 参数1为函数 参数2为序列 功能:用于过滤序列,把传入的函数一次作用域序列每个元素,根据返回的是True还是False决定是否保留该元素. ...
- Scrapy连接到各类数据库(SQLite,Mysql,Mongodb,Redis)
如何使用scrapy连接到(SQLite,Mysql,Mongodb,Redis)数据库,并把爬取的数据存储到相应的数据库中. 一.SQLite 1.修改pipelines.py文件加入如下代码 # ...
- c++语法(3)
子类覆盖父类的成员函数: #include "stdafx.h" #include "iostream" class CAnimal { protected: ...
- Django_前介
Django 1.软件框架 一个公司是由公司中的各部部门来组成的,每一个部门拥有特定的职能,部门与部门之间通过相互的配合来完成让公司运转起来. 一个软件框架是由其中各个软件模块组成的,每一个模 ...
- MobileNets: Open-Source Models for Efficient On-Device Vision
https://research.googleblog.com/2017/06/mobilenets-open-source-models-for.html Wednesday, June 14, ...
- IOC&AOP
- 吴裕雄--天生自然 pythonTensorFlow自然语言处理:Attention模型--测试
import sys import codecs import tensorflow as tf # 1.参数设置. # 读取checkpoint的路径.9000表示是训练程序在第9000步保存的ch ...
- nginx 配合jersey+netty的奇怪问题
角色 client proxy nginx server jersey+netty 问题表现 client 直接请求server 正常,返回准确json数据 jsondat client->ng ...
- iOS之input file调用相册控制器消失跳转到登陆页
最近在做一个app要用到H5,其中有一个需求是要点击H5的的控件弹出系统相册,通过在H5的input file 中定义<input type="file" class=&qu ...
- 从 0 到 1 到完美,写一个 js 库、node 库、前端组件库
之前讲了很多关于项目工程化.前端架构.前端构建等方面的技术,这次说说怎么写一个完美的第三方库. 1. 选择合适的规范来写代码 js 模块化的发展大致有这样一个过程 iife => commonj ...