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

相关文章
|
14天前
|
NoSQL 关系型数据库 Redis
mall在linux环境下的部署(基于Docker容器),Docker安装mysql、redis、nginx、rabbitmq、elasticsearch、logstash、kibana、mongo
mall在linux环境下的部署(基于Docker容器),docker安装mysql、redis、nginx、rabbitmq、elasticsearch、logstash、kibana、mongodb、minio详细教程,拉取镜像、运行容器
mall在linux环境下的部署(基于Docker容器),Docker安装mysql、redis、nginx、rabbitmq、elasticsearch、logstash、kibana、mongo
|
15天前
|
Ubuntu Linux Docker
Ubuntu 18.04 安装Docker实战案例
关于如何在Ubuntu 18.04系统上安装Docker的实战案例,包括安装步骤、配置镜像加速以及下载和运行Docker镜像的过程。
89 3
Ubuntu 18.04 安装Docker实战案例
|
15天前
|
存储 Linux Docker
CentOS 7.6安装Docker实战案例及存储引擎和服务进程简介
关于如何在CentOS 7.6上安装Docker、介绍Docker存储引擎以及服务进程关系的实战案例。
56 3
CentOS 7.6安装Docker实战案例及存储引擎和服务进程简介
|
1天前
|
Prometheus 监控 Cloud Native
docker安装prometheus+Granfan并监控容器
【9月更文挑战第14天】本文介绍了在Docker中安装Prometheus与Grafana并监控容器的步骤,包括创建配置文件、运行Prometheus与Grafana容器,以及在Grafana中配置数据源和创建监控仪表盘,展示了如何通过Prometheus抓取数据并利用Grafana展示容器的CPU使用率等关键指标。
|
16天前
|
Docker 容器
Docker安装Gitlab和Gitlab-Runner并实现项目CICD
Docker安装Gitlab和Gitlab-Runner并实现项目CICD
|
4月前
|
缓存 关系型数据库 MySQL
百度搜索:蓝易云【CentOS8服务器安装MySQL报错:no match mysql-community-server】
现在,你已经成功安装了MySQL服务器并解决了"no match mysql-community-server"的报错问题。祝你使用愉快!
85 1
|
3月前
|
Linux 数据库管理 Python
CentOS7编译安装Python3.10(含OpenSSL1.1.1安装),创建虚拟环境,运行Django项目(含sqlite版本报错)
CentOS7编译安装Python3.10(含OpenSSL1.1.1安装),创建虚拟环境,运行Django项目(含sqlite版本报错)
491 4
|
1月前
|
网络协议 Linux
CentOS7 yum安装报错“Could not resolve host: mirrorlist.centos.org;"之解决办法(换源)
CentOS7 yum安装报错“Could not resolve host: mirrorlist.centos.org; Name or service not known“之解决办法(换源)
|
9月前
|
Linux Shell Swift
django(二)centos安装django3.2报错SQLite 3.8.3 or later is required (found 3.7.17)
我正在参加「掘金·启航计划」 Centos安装diango3.2框架请参照《django(一)ubuntu18.04安装框架》 在运行: 复制代码 python3 manage.py runserver 0.0.0.0:81 的时候报错: swift 复制代码 django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is required (found 3.7.17). 报错的大体意思是:对sqlite最低版本的需求的3.8.3,但是现在只找到了3.7.17。
127 1
|
10月前
Cannot download repomd.xml解决CentOS8 yum安装AppStream报错
Cannot download repomd.xml解决CentOS8 yum安装AppStream报错
351 0