2020最简洁的docker安装流程

简介: 本篇内容记录了docker的安装流程。

1.在Centos上安装


linux内核版本依赖

kernel version >= 3.8

可以使用如下命令查看


uname -a | awk '{split($3, arr, "-"); print arr[1]}'
[root@docker ~]# uname -a | awk '{split($3, arr, "-"); print arr[1]}'
3.10.0


关闭防火墙关闭selinux


systemctl stop firewalld
getenfore 0


2、如果已安装过Docker, 需要移除老版本的Docker


yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine


3、添加Docker repository yum源


https://mirrors.ustc.edu.cn/docker-ce/linux/centos/docker-ce.repo


把链接粘贴到浏览器,即可下载到电脑,通过xshell安装yum install lrzsz -y 即可直接将文件拉取到linux中来,要把docker-ce.repo放到**/etc/yum.repos.d/**,目录下


wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum install epel-release -y
yum install container-selinux -y
yum makecache fast
yum install docker-ce docker-ce-cli containerd.io


4、开启Docker


systemctl enable docker
systemctl start docker


5、验证


[root@docker ~]# docker run helloworld
Unable to find image 'helloworld:latest' locally
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.
    (amd64)
 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
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/


相关文章
|
7天前
|
Linux 虚拟化 Docker
Windows10安装Docker Desktop(大妈看了都会)
Windows10安装Docker Desktop(大妈看了都会)
151 2
|
3天前
|
存储 Linux 网络安全
Centos安装Docker的详细安装步骤,Docker相关组件:docker-ce-cli、docker-ce和containerd.io的区别
Centos安装Docker的详细安装步骤,Docker相关组件:docker-ce-cli、docker-ce和containerd.io的区别;CentOS7安装DockerCompose;Docker镜像仓库
|
1天前
|
Docker 容器
docker安装minio
以上就是在Docker中安装MinIO的步骤。
9 2
|
1天前
|
Docker 容器
docker desktop安装es并连接elasticsearch-head:5
以上就是在Docker Desktop上安装Elasticsearch并连接Elasticsearch-head:5的步骤。
11 2
|
4天前
|
应用服务中间件 API 数据库
Docker 安装 KONG 带你玩转 API 网关
**摘要:** 在微服务架构中,API网关Kong作为流行开源选择,提供身份验证、安全和流量控制等功能。通过Docker部署Kong简单高效。步骤包括:创建Docker网络,部署PostgreSQL数据库,初始化Kong数据库,启动Kong容器,并检查运行状态。此外,安装Konga管理界面便于直观管理Kong。使用Docker命令行,逐步设置环境变量和网络连接,即可完成安装。当不再需要时,可清理相关容器和网络。Kong结合Konga,为API管理提供强大且用户友好的解决方案。
16 1
|
10天前
|
Ubuntu 持续交付 Docker
如何在 Ubuntu 20.04 上安装 Docker和DockerCompose
如何在 Ubuntu 20.04 上安装 Docker和DockerCompose
171 0
|
13天前
|
Linux Docker 索引
docker(二):Centos安装docker
docker(二):Centos安装docker
117 0
|
2月前
|
Ubuntu 网络安全 数据安全/隐私保护
百度搜索:蓝易云【docker通过dockerfile安装sftp教程。】
现在,你已经通过 Dockerfile 成功安装了 SFTP,并且可以使用指定的用户名和公钥进行远程访问。请确保替换示例中的用户名、密码和公钥为自己的实际值。
124 1
|
9月前
|
消息中间件 Shell RocketMQ
百度搜索:蓝易云 ,常用环境部署—Docker安装RocketMQ教程!
通过按照上述步骤,您可以在Docker中成功安装和部署RocketMQ。请注意,上述命令仅提供了一个基本的安装和配置过程,具体配置和使用可以根据您的需求进行进一步调整。确保在执行命令之前,您已经安装并配置好Docker环境。
150 0
|
2月前
|
关系型数据库 MySQL 数据库
docker 安装mysql(踩坑踩得想哭 详细解决教程)ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using pa
docker 安装mysql(踩坑踩得想哭 详细解决教程)ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using pa
175 1