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...

相关文章
|
1天前
|
Java 应用服务中间件 Linux
Centos7 安装JDK和Tomcat
Centos7 安装JDK和Tomcat
8 0
|
1天前
|
Linux Docker 容器
最全树莓派4B安装docker-compose(64位Linux)(1),2024年最新一文说清
最全树莓派4B安装docker-compose(64位Linux)(1),2024年最新一文说清
|
1天前
|
运维 网络协议 Linux
2024年最全CentOS8 Consul微服务架构安装(1)_agent(1),Linux运维开发面试
2024年最全CentOS8 Consul微服务架构安装(1)_agent(1),Linux运维开发面试
|
3天前
|
安全 关系型数据库 MySQL
解决centos7.0安装mysql后出现access defind for user@'localhost'的错误
在使用yum 安装完mariadb, mariadb-server, mariadb-devel后
7 0
|
4天前
|
Linux 网络安全 数据安全/隐私保护
centos7安装gitlab-ce社区版全过程,详细到爆炸,这些面试官常问的开发面试题你都掌握好了吗
centos7安装gitlab-ce社区版全过程,详细到爆炸,这些面试官常问的开发面试题你都掌握好了吗
|
4天前
|
存储 Linux Docker
CentOS7修改Docker容器和镜像默认存储位置
CentOS7修改Docker容器和镜像默认存储位置
|
4天前
|
jenkins 持续交付 数据安全/隐私保护
Docker 安装 Jenkins
Jenkins 是一个独立的开源自动化服务器,可用于自动化与构建、测试、交付或部署软件相关的各种任务。
26 1
|
4天前
|
Linux Docker 容器
安装新版本Docker报错container-selinux >= 2:2.74 - 蓝易云
以上步骤应该能够帮助你解决遇到的问题。如果问题仍然存在,你可能需要寻求专业的技术支持。
21 0
|
5天前
|
Ubuntu Linux Docker
window10下安装ubuntu系统以及docker使用
window10下安装ubuntu系统以及docker使用
|
6天前
|
并行计算 Ubuntu Docker
Docker环境Ubuntu20.04安装Python3.10版本
Docker环境Ubuntu20.04安装Python3.10版本
50 0

热门文章

最新文章