Centos7 安装docker

简介: CentOS 7 安装docker,要求系统必须为64位、系统内核版本为 3.10 以上。查看系统版本信息:[root@JDu4e00u53f7 ~]# cat /etc/centos-releaseCentOS Linux release 7.
  1. CentOS 7 安装docker,要求系统必须为64位、系统内核版本为 3.10 以上。查看系统版本信息:
[root@JDu4e00u53f7 ~]# cat /etc/centos-release
CentOS Linux release 7.3.1611 (Core) 
[root@JDu4e00u53f7 ~]# uname -r
3.10.0-693.11.6.el7.x86_64
  1. 安装docker
[root@JDu4e00u53f7 ~]# yum install docker -y
  1. 启动docker服务
[root@JDu4e00u53f7 ~]# systemctl start docker
[root@JDu4e00u53f7 ~]# docker version
Client:
 Version:         1.13.1
 API version:     1.26
 Package version: <unknown>
 Go version:      go1.8.3
 Git commit:      774336d/1.13.1
 Built:           Wed Mar  7 17:06:16 2018
 OS/Arch:         linux/amd64

Server:
 Version:         1.13.1
 API version:     1.26 (minimum version 1.12)
 Package version: <unknown>
 Go version:      go1.8.3
 Git commit:      774336d/1.13.1
 Built:           Wed Mar  7 17:06:16 2018
 OS/Arch:         linux/amd64
 Experimental:    false
  1. 配置镜像加速
    鉴于国内网络问题,后续拉取 Docker 镜像十分缓慢,我们可以需要配置加速器来解决.
[root@JDu4e00u53f7 ~]# vim /etc/docker/daemon.json

新增网易的docker镜像加速地址:

{
  "registry-mirrors": ["http://hub-mirror.c.163.com"]
}

在这里我更推荐使用阿里云docker镜像加速,速度要比网易的更快。首先进入阿里云镜像库首页,点击管理中心

img_8a8bab46517247dab59fe9c9b0d1c501.png
image.png

img_e040e820f90310f94078554a13275c42.png

复制加速器地址到 daemon.json中,然后重启docker:

[root@JDu4e00u53f7 ~]# systemctl restart docker
  1. 测试运行 hello-world
[root@JDu4e00u53f7 ~]# docker run hello-world
Unable to find image 'hello-world:latest' locally
Trying to pull repository docker.io/library/hello-world ... 
latest: Pulling from docker.io/library/hello-world
ca4f61b1923c: Pull complete 
Digest: sha256:97ce6fa4b6cdc0790cda65fe7290b74cfebd9fa0c9b8c38e979330d547d22ce1
Status: Downloaded newer image for docker.io/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.
    (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://cloud.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/engine/userguide/

To be continued...

相关文章
|
7天前
|
缓存 Ubuntu Linux
Linux中yum、rpm、apt-get、wget的区别,yum、rpm、apt-get常用命令,CentOS、Ubuntu中安装wget
通过本文,我们详细了解了 `yum`、`rpm`、`apt-get`和 `wget`的区别、常用命令以及在CentOS和Ubuntu中安装 `wget`的方法。`yum`和 `apt-get`是高层次的包管理器,分别用于RPM系和Debian系发行版,能够自动解决依赖问题;而 `rpm`是低层次的包管理工具,适合处理单个包;`wget`则是一个功能强大的下载工具,适用于各种下载任务。在实际使用中,根据系统类型和任务需求选择合适的工具,可以大大提高工作效率和系统管理的便利性。
63 25
|
24天前
|
关系型数据库 MySQL 数据库
Docker Compose V2 安装常用数据库MySQL+Mongo
以上内容涵盖了使用 Docker Compose 安装和管理 MySQL 和 MongoDB 的详细步骤,希望对您有所帮助。
128 42
|
17天前
|
监控 Linux PHP
【02】客户端服务端C语言-go语言-web端PHP语言整合内容发布-优雅草网络设备监控系统-2月12日优雅草简化Centos stream8安装zabbix7教程-本搭建教程非docker搭建教程-优雅草solution
【02】客户端服务端C语言-go语言-web端PHP语言整合内容发布-优雅草网络设备监控系统-2月12日优雅草简化Centos stream8安装zabbix7教程-本搭建教程非docker搭建教程-优雅草solution
68 20
|
1月前
|
Linux Docker 容器
安装docker-18.06报错Error: libseccomp conflicts with docker-18.06
通过这些步骤,您可以成功在CentOS上安装Docker 18.06,并解决libseccomp的冲突问题。这些方法确保系统兼容性,并保证Docker的正常运行。
61 27
|
18天前
|
Ubuntu API 网络虚拟化
ubuntu22 编译安装docker,和docker容器方式安装 deepseek
本脚本适用于Ubuntu 22.04,主要功能包括编译安装Docker和安装DeepSeek模型。首先通过Apt源配置安装Docker,确保网络稳定(建议使用VPN)。接着下载并配置Docker二进制文件,创建Docker用户组并设置守护进程。随后拉取Debian 12镜像,安装系统必备工具,配置Ollama模型管理器,并最终部署和运行DeepSeek模型,提供API接口进行交互测试。
261 15
|
16天前
|
消息中间件 Kafka Docker
docker compose 安装 kafka
通过本文的步骤,您可以快速在本地使用 Docker Compose 安装并配置 Kafka 和 Zookeeper。Docker Compose 简化了多容器应用的管理,方便快速搭建和测试分布式系统。
57 2
|
2月前
|
存储 Shell 网络安全
Centos7.9安装openldap
Centos7.9安装openldap
59 16
|
10月前
|
Ubuntu 网络安全 数据安全/隐私保护
百度搜索:蓝易云【docker通过dockerfile安装sftp教程。】
现在,你已经通过 Dockerfile 成功安装了 SFTP,并且可以使用指定的用户名和公钥进行远程访问。请确保替换示例中的用户名、密码和公钥为自己的实际值。
199 1
|
消息中间件 Shell RocketMQ
百度搜索:蓝易云 ,常用环境部署—Docker安装RocketMQ教程!
通过按照上述步骤,您可以在Docker中成功安装和部署RocketMQ。请注意,上述命令仅提供了一个基本的安装和配置过程,具体配置和使用可以根据您的需求进行进一步调整。确保在执行命令之前,您已经安装并配置好Docker环境。
206 0
|
4月前
|
缓存 Linux Docker
【最新版正确姿势】Docker安装教程(简单几步即可完成)
之前的老版本Docker安装教程已经发生了变化,本文分享了Docker最新版安装教程,其他操作系统版本也可以参考官 方的其他安装版本文档。
4222 3
【最新版正确姿势】Docker安装教程(简单几步即可完成)