Docker安装

Posted skymei

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Docker安装相关的知识,希望对你有一定的参考价值。

2019-10-17

     寻找合适的docker Yum源木配置文件

    下面是清华大学Yum源的网址:

     https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/

     1,下载想要的Yum源文件,/etc/yum.repos.d

   

wget https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/docker-ce.repo

 

    2,修改yum的默认下载地址  vim打开 docker-ce.repo 修改下载连接,把download.docker.com 替换成清华大学的地址 mirrors.tuna.tsinghua.edu.cn/docker-ce

 vim /etc/yum.repos.d/docker-ce.repo

 技术图片

   3,查看更新Yum源缓存:

 

yum repolist 

技术图片

    4, Yum安装安装 Docker-CE,一般个人用建议安装CE版的

       

Yum install –y  docker-ce

     5,Docker镜像下载加速,为的是以后下载各种Docker镜像速度更快

技术图片
mkdir –p /etc/docker
vim /etc/docker/daemon.json  ##加入相关国内镜像地址。

{
  "registry-mirrors" : ["https://4mii0w1b.mirror.aliyuncs.com","https://registry.docker-cn.com"]
}
View Code

     6,查看Docker相关信息

   

技术图片
 docker version


Client: Docker Engine - Community
 Version:           19.03.2
 API version:       1.40
 Go version:        go1.12.8
 Git commit:        6a30dfca03
 Built:             Thu Aug 29 05:26:30 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.2
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.8
  Git commit:       6a30dfca03
  Built:            Thu Aug 29 05:32:56 2019
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.2.6
  GitCommit:        894b81a4b802e4eb2a91d1ce216b8817763c29fb
 runc:
  Version:          1.0.0-rc8
  GitCommit:        425e105d5a03fabd737a126ad93d62a9eeede87f
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683
View Code
docker info
Client:
 Debug Mode: false

Server:
 Containers: 3
  Running: 0
  Paused: 2
  Stopped: 1
 Images: 7
 Server Version: 19.03.2
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 894b81a4b802e4eb2a91d1ce216b8817763c29fb
 runc version: 425e105d5a03fabd737a126ad93d62a9eeede87f
 init version: fec3683
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 3.10.0-957.1.3.el7.x86_64
 Operating System: CentOS Linux 7 (Core)
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 15.67GiB
 Name: mailtest
 ID: FZJT:E6MR:WWBA:A3VA:SZCT:6WDL:ABRZ:ND4V:FYGU:IXL3:J5XU:7T4U
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Registry Mirrors:
  https://4mii0w1b.mirror.aliyuncs.com/
  https://registry.docker-cn.com/
 Live Restore Enabled: false
 Product License: Community Engine

 

以上是关于Docker安装的主要内容,如果未能解决你的问题,请参考以下文章

markdown docker-compose片段

sh Docker片段

Docker初级——介绍安装和使用

Docker和pip安装:避免在已安装某些软件包时安装所有软件包

在Tomcat的安装目录下conf目录下的server.xml文件中增加一个xml代码片段,该代码片段中每个属性的含义与用途

PHP代码-psysh调试代码片段工具