《专题五 容器化微服务》之《第二章 容器化技术》之《第一节 Docker容器》

文章目录

  • 《2.1.1 docker介绍及使用》
  • 《2.1.2 docker 的存储和网络》
  • 《2.1.3 docker 实践》

《2.1.1 docker介绍及使用》

  • 3分 概念:
    在这里插入图片描述
  • 虚拟机 vs 容器:
    在这里插入图片描述
  • 12 7 docker服务架构
  • 12 40 Docker:Build,Ship,Run
    在这里插入图片描述
  • 13 50 Docker安装:按官网上的Install Docker Engine on CentOS。Start Docker:sudo systemctl start docker
  • Docker启停容器等命令:
    在这里插入图片描述
    在这里插入图片描述

我实验用的命令,以及结果(部分):

  1. docker images
  2. REPOSITORY TAG IMAGE ID CREATED SIZE
  3. hello-world latest bf756fb1ae65 13 months ago 13.3kB
  4. docker create --name test hello-world
  5. 3a68df3746346a7942a13903083927780ff0a5eaff950dba6853de18f6b20c41
  6. docker ps -a
  7. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
  8. 3a68df374634 hello-world "/hello" About a minute ago Created test
  9. ced7b419db32 hello-world "/hello" 3 hours ago Exited (0) 3 hours ago trusting_rosalind
  10. docker start test
  11. docker logs test
  12. docker stop test

又如docker create --name testRedis hub.c.163.com/public/redis:2.8.4后,docker ps -a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b4ac0866bd98 hub.c.163.com/public/redis:2.8.4 “/run.sh” 48 seconds ago Created testRedis
ed7a89668594 hello-world “/hello” 11 minutes ago Exited(0) 8 minutes ago test
d0fb817256c1 hello-world “/hello” 18 minutes ago Exited (0) 18 minutes ago flamboyant_ramanujan
90f794425930 hello-world “/hello” 18 minutes ago Exited (0) 18 minutes ago unruffled_wozniak

  1. docker start testRedis
  2. docker ps -a
  3. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
  4. b4ac0866bd98 hub.c.163.com/public/redis:2.8.4 "/run.sh" 8 minutes ago Up 36 seconds 6379/tcp testRedis
  5. ed7a89668594 hello-world "/hello" 19 minutes ago Exited (0) 16 minutes ago test
  6. d0fb817256c1 hello-world "/hello" 26 minutes ago Exited (0) 26 minutes ago flamboyant_ramanujan
  7. 90f794425930 hello-world "/hello" 26 minutes ago Exited (0) 26 minutes ago unruffled_wozniak

查看其日志:docker logs testRedis

  • 22 20 docker容器状态转化:
    在这里插入图片描述
  • 23 50 Docker容器隔离
  • 28 19+ Docker对容器的资源使用限制
  • 36 32+ Docker容器的进程与容器状态
    在这里插入图片描述
  • 39 45+ 如何制作docker镜像
    • docker镜像是什么:
      在这里插入图片描述
    • 41 43+ Dockerfile镜像制作示例:
      在这里插入图片描述
    • 48 12+ Docker镜像分发
    • 66 53+ Dockerfile常用指令
    • 69 40 如何优雅地写Dockerfilie:
      在这里插入图片描述
      docker应尽量做到专一,多个docker可通过组合来完成复杂功能,可秒级部署且更灵活

《2.1.2 docker 的存储和网络》

  • 9:30 docker volume 容器数据卷:
    在这里插入图片描述
  • 12 54+ docker容器如何与宿主机共享数据
    在这里插入图片描述
    • 19 32 Docker的volume模块。我:volumeName相当于卷的变量,本质是对上图的hostPath的封装。卷的生命周期和容器的生命周期是独立的
      在这里插入图片描述
    • 25 49+ Docker高速存储卷
    • 27 21 docker三种卷共享方式的比较
      在这里插入图片描述
  • 29 1+ Docker容器的网络:
    • 32 21+ 容器网络的隔离沙箱:net namespace
    • 34 30 两个容器如何网络互通:
      在这里插入图片描述
    • 40 13+ 多容器如何网络互通
    • 43 37 Docker Bridge模式
  • 53 17+ 容器跨节点间通信

《2.1.3 docker 实践》

  • 9 9 容器化改造流程
  • 56 16 日志和监控查看:
    在这里插入图片描述
  • 60 44 升级和故障迁移
  • 63 30 容器编排调度:
    在这里插入图片描述

发表评论

表情:
评论列表 (有 0 条评论,69人围观)

还没有评论,来说两句吧...

相关阅读