Docker安装步骤
在学习springcloud的消息总线时,需要安装rabbitmq,因为rabbitmq是用erlang开发的,所以安装rabbitmq又需要先安装erlang,总之安装过程中遇到各种坑,然而最终还是没有安装成功,最后就打算放弃普通的安装方式,用基于docker的方式来安装,这也就是今天的主题:docker的安装步骤,在docker安装的过程中,同样也是困难重重,一开始我是在32位的Centos6.5下安装的,结果遇到各种问题,后来才发现docker是不支持32位操作系统的,然后又重新在虚拟机上装了64位的Centos7,下面记录一下我的安装步骤:
一、准备环境:64位Centos7(注意:这里的系统一定要是64位的,docker不支持32位操作系统,且Centos6和Centos7安装命令是不同的,这里我是基于Centos7进行安装)
1.查看centos系统的版本:
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.5. (Core)
[root@localhost ~]#
2.查看内核版本:
[root@localhost ~]#
[root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.-.el7.x86_64 # SMP Fri Apr :: UTC x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]#
二、安装步骤:
1.安装所需的软件包。
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
2.添加Docker软件包源 。
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
以上命令会在/etc/yum.repos.d/ 目录下生成docker-ce.repo文件
3.(可选)启用 edge 和 testing 镜像仓库。这些镜像仓库包含在上述 docker.repo 文件中,但默认情况下处于禁用状态。您可以将它们与 stable 镜像仓库一起启用。
sudo yum-config-manager --enable docker-ce-edge
sudo yum-config-manager --enable docker-ce-testing
4.更新 yum 软件包索引。
sudo yum makecache fast
5.安装 Docker CE。
sudo yum install docker-ce
6.启动 Docker。
sudo systemctl start docker
7.验证是否正确安装了 docker,方法是运行 hello-world 镜像。
sudo docker run hello-world
[root@localhost ~]# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1b930d010525: Pull complete
Digest: sha256:92695bc579f31df7a63da6922075d0666e565ceccad16b59c3374d2cf4e8e50e
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:
. The Docker client contacted the Docker daemon.
. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
. 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 Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/ For more examples and ideas, visit:
https://docs.docker.com/get-started/
出现如上代码说明我们的docker已经安装好了,让我们一起进入我们的docker之旅吧!
(注意:如果是root用户的话以上的所有命令前面不用加sudo,如果你的普通用户不可以执行sudo,可以切换到root用户执行上面命令,或者切换到root用户 vi /etc/sudoers ,
假如你的用户名为zhangsan,在 root ALL=(ALL) ALL后面加一行 zhangsan ALL=(ALL) ALL,这样再切换到zhangsan用户下就可以执行sudo命令了)。
[root@localhost fanjf]# vi /etc/sudoers
## Sudoers allows particular users to run various commands as
## the root user, without needing the root password.
root ALL=(ALL) ALL
zhangsan ALL=(ALL) ALL
#.......
#.......
#.......
Docker安装步骤的更多相关文章
- Docker应用部署实录(包含完善Docker安装步骤)
Docker应用部署实录(包含完善Docker安装步骤) 前言 首先说一下这篇文章的来源.我之前接手的一个IOT项目,需要安装多个中控服务器.中控服务器需要安装RabbitMQ,Mysql,多个服务, ...
- ubuntu环境下docker安装步骤
本文是根据docker官方文档翻译,原文:https://docs.docker.com/engine/installation/linux/ubuntulinux/ Docker 支持以下 Ubun ...
- DOCKER 安装步骤-最靠谱的笔记
一.系统环境规划 服务器名 项目名称 docker 操作系统 CentOS Linux release 7.1.1503 (Core) Docker 版本 17.03.2-ce 二.Docker ...
- windows docker 安装cloudera/quickstart
最近需要写一个大数据的项目,但是公司没有测试环境,真是cao蛋,没办法,只能自己搭建一个测试环境,所以就在本地电脑装一个cloudera/quickstart,这个是一个单节点的大数据平台, 是clo ...
- Docker安装之路
从3月初到现在,一直在安装docker 的路上越走越远,大概就在1个小时前,我终于成功了,那一刻,我觉得我拥有了整个世界,于是乎,拥有了整个世界的我决定草率的并粗略的记录一下安装过程中遇到的我能记住的 ...
- Docker:docker安装部署jenkins
Docker安装步骤请转到:https://www.cnblogs.com/nhdlb/p/11262527.html 查看docker的jenkins镜像版本 #查看jenkins版本命令 dock ...
- mac系统下docker安装配置mysql详细步骤
上文介绍了MacOS安装Docker傻瓜式教程,安装好后第一件事就决定把本地数据库迁移过来,那么首先就得安装mysql,下面就开始我们的安装之旅吧. 一.docker配置镜像加速器 我们使用docke ...
- docker安装mysql、es、jenkins等一些步骤以及如何设置docker国内镜像
CentOS7安装Docker步骤: (0)删除旧的可能安装过的包 yum remove docker \ docker-client \ ...
- Docker Desktop for Windows 安装步骤
Docker Desktop for Windows 安装要求 Docker Desktop for Windows需要运行Microsoft Hyper-V.如果需要,Docker Desktop ...
随机推荐
- vue 导出xlsx表功能
详细步骤: 1.需要安装三个依赖: npm install -S file-saver xlsx npm install -D script-loader 两个命令行包含三个依赖. 2.项目中src下 ...
- struct导入项目工程时工程旁边出现红色的×号
在我们学习java的过程中难免要导入java工程项目,那么当我们导进去的时候出现错误怎么办呢, 一,首先 二,其次 选择Properties 三,再选择 四,再选择 (高版本的选择1.5尽量用1.6的 ...
- Python总结(二)
学习一门语言,首先就要学习它的数据类型和语法.这里与JS进行对比学习. 1.数据类型 python的数据类型有:数字(int).浮点(float).字符串(str),列表(list).元组(tuple ...
- P4013 数字梯形问题 网络流
题目描述 给定一个由 nn 行数字组成的数字梯形如下图所示. 梯形的第一行有 mm 个数字.从梯形的顶部的 mm 个数字开始,在每个数字处可以沿左下或右下方向移动,形成一条从梯形的顶至底的路径. 分别 ...
- pytorch的函数中的dilation参数的作用
如果我们设置的dilation=0的话,效果如图: 蓝色为输入,绿色为输出,可见卷积核为3*3的卷积核 如果我们设置的是dilation=1,那么效果如图: 蓝色为输入,绿色为输出,卷积核仍为3*3, ...
- 特殊需求:EF 6.x如何比较TimeSpan格式的字符串?EF Core实现方式是否和EF 6.x等同?
前言 我们知道C#中的TimeSpan对应SQL Server数据库中的Time类型,但是如果因为特殊需求数据库存储的不是Time类型,而是作为字符串,那么我们如何在查询数据时对数据库所存储的字符串类 ...
- JS Jquery 中 的遍历
$.each()和$().each(),以及forEach()的用法 1.forEach是js中遍历数组的方法,如下 var arr=[1,2,3,4];arr.forEach(functio ...
- 前后端分离与 restful api
为什么要前后端分离(优点): PC,APP,PAD 多端适应 单页面应用(Single Page Application)SPA开发模式开始流行 前后端开发职责不清 开发效率问题,前后端互相等待 前端 ...
- c# 属性改变
using System.ComponentModel; using System.Threading; using System.Windows.Forms; using app.Viewer.Vi ...
- Linux查看文件大小
//查看系统中文件的使用情况 df -h //查看当前目录下各个文件及目录占用空间大小 du -sh * //查看welcome.txt文件占用空间大小 du -sh welcome.txt //方法 ...