1、从远程仓库查看所需镜像

[root@localhost docker]# docker search centos8

NAME                                 DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED

2233466866/centos8                   https://hub.docker.com/r/2233466866/centos8     4

thinakar/centos8                     centos8 core with net-utils, vim, sshuttle      0

memiiso/centos8-java8python3docker   centos8-java8python3docker                      0

memiiso/centos8-java8python3         centos8 With java8 and python3                  0

nmstate/centos8-nmstate-dev                                                          0

prestocpp/centos8-gcc9                                                               0

wuykimpang/centos8-extended                                                          0

memiiso/centos8-java8                centos8-java8                                   0

alekseychudov/centos8-systemd        CentOS 8 based systemd image                    0

sharpreflections/centos8-build       CentOS8 with development tools                  0

ydli/centos8                         centos8.2 with ansible-2.9.10, awscli-1.18.8…   0

vglad/centos8                        Based on official latest CentOS 8 image with…   0

8378006361/centos8.2.2004                                                            0

loging/centos8-python37              centos8 + python3.7.5                           0

krestomatio/centos8-minimal          Testing a Centos 8 minimal container image l…   0

2、从远程仓库拉取所需镜像

[root@localhost docker]# docker pull alekseychudov/centos8-systemd

Using default tag: latest

latest: Pulling from alekseychudov/centos8-systemd

2b7820d659b3: Pull complete

Digest: sha256:a03592eb8be9af3c6c910d209b7d231a4aee19d42c72082ec6a3b021f323516b

Status: Downloaded newer image for alekseychudov/centos8-systemd:latest

docker.io/alekseychudov/centos8-systemd:latest

3、查看下载到本地镜像

[root@localhost docker]# docker images

REPOSITORY                      TAG                 IMAGE ID            CREATED             SIZE

mysql                           latest              e3fcc9e1cc04        12 days ago         544MB

osism/kolla-ansible             queens-latest       cfb5bad016bd        5 months ago        302MB

alekseychudov/centos8-systemd   latest              e13569384aea        6 months ago        256MB

4、创建容器

[root@localhost docker]# docker run -dit --name=centospy3 e13569384aea /bin/bash

7424ba3acdd87e4d65e8a3635914acf8152a745ec019e1f4cbd8873cd26f7f47

5、查看创建容器

[root@localhost docker]# docker ps -a

CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

7424ba3acdd8        e13569384aea        "/bin/bash"         2 minutes ago       Up 2 minutes                            centospy3

6、进入容器

[root@localhost docker]# docker exec -it centospy3 /bin/bash

[root@7424ba3acdd8 /]#

故障1:客户机192.168.10.103与docker本地仓库192.168.10.102网络不通;

[root@localhost docker]# docker push 192.168.10.102:5000/client102-hello-world

The push refers to repository [192.168.10.102:5000/client102-hello-world]

Get https://192.168.10.102:5000/v2/: dial tcp 192.168.10.102:5000: connect: no route to host

解决办法:查看网卡接口是否打开

[root@localhost docker]# nmcli connection

NAME     UUID                                  TYPE      DEVICE

ens33    c96bc909-188e-ec64-3a96-6a90982b08ad  ethernet  ens33

ens34    94aea789-efb3-ef4c-81b0-e8b18ecc9797  ethernet  ens34

docker0  9fd5b1df-f8fc-4a54-a9b3-59119a6838ce  bridge    docker0

[root@localhost docker]# nmcli c up ens33

Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/7)

故障2:docker本地仓库的端口5000没有开启,通过本地防火墙开放端口

[root@localhost ~]# firewall-cmd --get-active-zones

查看防火墙活动区域

public

interfaces: ens33 ens34

[root@localhost ~]# firewall-cmd --zone=public --list-ports

查看防火墙的已开放端口

5000/tcp

[root@localhost ~]# firewall-cmd --zone=public  --add-port=5000/tcp --permanent

在public区域开放端口5000

success

[root@localhost ~]# firewall-cmd --zone=public --query-port=5000/tcp

查看端口5000是否开放

yes

[root@localhost ~]# firewall-cmd --reload

重启软件防火墙

Success

[root@localhost ~]# systemctl restart firewalld.service

重启防火墙服务

故障3:报错“ http: server gave HTTP response to HTTPS client”

解决办法:

[root@localhost /]# vim /etc/docker/daemon.json

{

"registry-mirrors": ["https://55660wdp.mirror.aliyuncs.com"],

"insecure-registries": ["192.168.10.102:4000"]

设定非安全注册为http

}

最新文章

  1. 基于Hadoop的密码安全级别验证
  2. 纯C#实现屏幕指定区域截屏
  3. WPS 认证机制
  4. 解决passwd 为普通用户设密码 不成功的方法
  5. firefox广告拦截插件
  6. 使用 Microsoft Fakes 进行单元测试
  7. Karaf 基于 osgi
  8. [译]Java Thread wait, notify和notifyAll示例
  9. 【暑假】[实用数据结构]UVAlive 4670 Dominating Patterns
  10. 戴尔笔记本win8.1+UEFI下安装Ubuntu14.04过程记录
  11. F题 - A+B for Input-Output Practice (V)
  12. facl笔记
  13. 物理引擎Havok教程(一)搭建开发环境
  14. nginx 特定目录禁止php执行
  15. poj2912 Rochambeau
  16. 关于 String 自我理解
  17. MT【327】两道不等式题
  18. 【AGC 002F】Leftmost Ball
  19. 前端入门18-JavaScript进阶之作用域链
  20. Python判断水仙花数

热门文章

  1. css外边距重叠及避免方法
  2. vue优点
  3. 【学习笔记】使用 bitset 求解较高维偏序问题
  4. activiti环境安装
  5. VirtualBox5.2.2 安装 CentOS 7
  6. css 15-Sass入门
  7. Web服务器-并发服务器-单进程单线程非堵塞方式(3.4.3)
  8. 面试官: ShardingSphere 学一下吧
  9. 在库中使用schematics——ng add与ng update
  10. CSS中margin:auto什么意思?margin:auto属性的用法详解