当前位置: 首页 > news >正文

海勃湾网站建设seo排名资源

海勃湾网站建设,seo排名资源,深圳网站建设注意事项,关键词推广seoDockerfile Docker镜像原理 Linux文件系统有bootfs和rootfs两部分组成 Docker镜像由特殊文件系统叠加 最底端bootfs,使用宿主机bootfs 第二次时rootfs,被称为基础镜像 向上可以叠加其他镜像文件 同一文件系统能将多层整合成一层,隐藏了多层存在 镜像可以放置…

Dockerfile

Docker镜像原理

Linux文件系统有bootfs和rootfs两部分组成

  • Docker镜像由特殊文件系统叠加

  • 最底端bootfs,使用宿主机bootfs

  • 第二次时rootfs,被称为基础镜像

  • 向上可以叠加其他镜像文件

  • 同一文件系统能将多层整合成一层,隐藏了多层存在

  • 镜像可以放置另一个镜像上面,位于下面的镜像成为父镜像

  • 当一个镜像启动容器时,Docker会在最顶层加载一个读写文件系统作为容器

    在这里插入图片描述

镜像制作

  • 容器转为镜像

    镜像不能传输

    镜像可以转为压缩文件,然后再去传输

查看容器
[root@server ~]# docker ps -a
CONTAINER ID   IMAGE       COMMAND                   CREATED        STATUS                     PORTS                                       NAMES
8ef7a9d24cdd   mysql:5.6   "docker-entrypoint.s…"   13 hours ago   Exited (255) 3 hours ago   0.0.0.0:3307->3306/tcp, :::3307->3306/tcp   c_mysql把c_mysql转成镜像[root@server ~]# docker commit 8ef7a9d24cdd mysql_iso
sha256:ee9adf5b156851692b4cf0fe6c25265ce9dc89924b3fc064935c859f875d1894
[root@server ~]# docker images
REPOSITORY   TAG       IMAGE ID       CREATED         SIZE
mysql_iso    latest    ee9adf5b1568   8 seconds ago   303MB
nginx        latest    605c77e624dd   16 months ago   141MB
redis        5.0       c5da061a611a   16 months ago   110MB
mysql        5.6       dd3b2a5dcb48   16 months ago   303MB
centos       7         eeb6ee3f44bd   19 months ago   204MB把镜像压缩 可以传输给别人[root@server ~]# docker save -o mysql_iso.tar mysql_iso
[root@server ~]# ll
总用量 300448
-rw-------. 1 root root      1241 424 13:04 anaconda-ks.cfg
drwxr-xr-x. 2 root root        50 56 19:41 data
drwxr-xr-x. 5 root root        42 57 00:50 mysql
-rw-------. 1 root root 307652096 57 13:39 mysql_iso.tar把mysql_iso删除,通过压缩文件还原成镜像[root@server ~]# docker rmi mysql_iso
Untagged: mysql_iso:latest
Deleted: sha256:ee9adf5b156851692b4cf0fe6c25265ce9dc89924b3fc064935c859f875d1894
Deleted: sha256:bde6bf72f86d605ec4185f4e7b6686b27a4704219760871f1cdedeff2f41b607[root@server ~]# docker images
REPOSITORY   TAG       IMAGE ID       CREATED         SIZE
nginx        latest    605c77e624dd   16 months ago   141MB
redis        5.0       c5da061a611a   16 months ago   110MB
mysql        5.6       dd3b2a5dcb48   16 months ago   303MB
centos       7         eeb6ee3f44bd   19 months ago   204MB还原镜像[root@server ~]# docker load -i mysql_iso.tar
01bd5c6edefd: Loading layer  6.656kB/6.656kB
Loaded image: mysql_iso:latest
[root@server ~]# docker images
REPOSITORY   TAG       IMAGE ID       CREATED          SIZE
mysql_iso    latest    ee9adf5b1568   10 minutes ago   303MB
nginx        latest    605c77e624dd   16 months ago    141MB
redis        5.0       c5da061a611a   16 months ago    110MB
mysql        5.6       dd3b2a5dcb48   16 months ago    303MB
centos       7         eeb6ee3f44bd   19 months ago    204MB通过这个镜像来运行一个新容器
[root@server ~]# docker run -id --name=c_mysql_n mysql_iso bash
[root@server ~]# docker exec -it c_mysql_n /bin/bash
root@97c993b5e148:/# 
  • dockerfile

概念

  • 文本文件

  • 包含了一条条指令

  • 每一条指令构建一层,基于基础镜像,最终构建出新镜像

Docker自定义centos7镜像

要求

  • 默认登录路径为/usr

  • 可以使用vim

查看镜像[root@server ~]# docker images
REPOSITORY   TAG       IMAGE ID       CREATED         SIZE
nginx        latest    605c77e624dd   16 months ago   141MB
tomcat       latest    fb5657adc892   16 months ago   680MB
redis        5.0       c5da061a611a   16 months ago   110MB
mysql        5.6       dd3b2a5dcb48   16 months ago   303MB
centos       7         eeb6ee3f44bd   19 months ago   204MB [root@server ~]# docker run -id --name=my_c centos:7
8cace6a4806c37f2c14d4b2779ff863087e8525959fc85238b023786f799cc5f
[root@server ~]# docker exec -it my_c bash
[root@8cace6a4806c /]# ll
total 12
-rw-r--r--.   1 root root 12114 Nov 13  2020 anaconda-post.log
lrwxrwxrwx.   1 root root     7 Nov 13  2020 bin -> usr/bin
drwxr-xr-x.   5 root root   340 May  7 06:56 dev
drwxr-xr-x.   1 root root    66 May  7 06:56 etc
drwxr-xr-x.   2 root root     6 Apr 11  2018 home
lrwxrwxrwx.   1 root root     7 Nov 13  2020 lib -> usr/lib
lrwxrwxrwx.   1 root root     9 Nov 13  2020 lib64 -> usr/lib64
drwxr-xr-x.   2 root root     6 Apr 11  2018 media
drwxr-xr-x.   2 root root     6 Apr 11  2018 mnt
drwxr-xr-x.   2 root root     6 Apr 11  2018 opt
dr-xr-xr-x. 125 root root     0 May  7 06:56 proc
dr-xr-x---.   2 root root   114 Nov 13  2020 root
drwxr-xr-x.  11 root root   148 Nov 13  2020 run
lrwxrwxrwx.   1 root root     8 Nov 13  2020 sbin -> usr/sbin
drwxr-xr-x.   2 root root     6 Apr 11  2018 srv
dr-xr-xr-x.  13 root root     0 May  7 05:08 sys
drwxrwxrwt.   7 root root   132 Nov 13  2020 tmp
drwxr-xr-x.  13 root root   155 Nov 13  2020 usr
drwxr-xr-x.  18 root root   238 Nov 13  2020 var
[root@8cace6a4806c /]# cd ~
[root@8cace6a4806c ~]# vim tmp.txt
bash: vim: command not found这里没有安装vim

根据需求编写Dockerfile

  • 定义父镜像:FROM centos:7

  • 定义作者信息:MAINAINER

  • 执行安装vim命令:RUN yum install -y vim

  • 定义默认工作路径:WORKDIR:/usr

  • 定义容器启动后执行命令:CMD /bin/bash


清空所有容器[root@server ~]# docker stop $(docker ps -aq)
8cace6a4806c
[root@server ~]# docker rm $(docker ps -aq)
8cace6a4806c[root@server ~]# mkdir docker-files
[root@server ~]# cd docker-files/
[root@server docker-files]# ll
总用量 0[root@server docker-files]# vim centos_dockerfile
[root@server docker-files]# cat centos_dockerfile
FROM centos:7
MAINTAINER rkun18RUN yum install -y vim
WORKDIR /usrCMD /bin/bash
[root@server docker-files]# docker build -f ./centos_dockerfile -t my_centos:1 .[+] Building 497.0s (7/7) FINISHED=> [internal] load build definition from centos_dockerfile                          0.1s=> => transferring dockerfile: 188B                                                 0.0s=> [internal] load .dockerignore                                                    0.0s=> => transferring context: 2B                                                      0.0s=> [internal] load metadata for docker.io/library/centos:7                          0.0s=> [1/3] FROM docker.io/library/centos:7                                            0.0s=> [2/3] RUN yum install -y vim                                                   494.9s=> [3/3] WORKDIR /usr                                                               0.0s=> exporting to image                                                               1.9s=> => exporting layers                                                              1.9s=> => writing image sha256:d110499cc5a06e4e74ea2b4c84b70ab745f7932ae6d1b54f4eb78f4  0.0s=> => naming to docker.io/library/my_centos:1                                       0.0s
[root@server docker-files]# docker images
REPOSITORY   TAG       IMAGE ID       CREATED              SIZE
my_centos    1         d110499cc5a0   About a minute ago   468MB
nginx        latest    605c77e624dd   16 months ago        141MB
tomcat       latest    fb5657adc892   16 months ago        680MB
redis        5.0       c5da061a611a   16 months ago        110MB
mysql        5.6       dd3b2a5dcb48   16 months ago        303MB
centos       7         eeb6ee3f44bd   19 months ago        204MB
  • 创建容器测试是否满足需求
[root@server ~]# docker run -id --name=c1 my_centos:1
821adf3c8a63d30daad86b759f2a7f5a021c0bb461700974e47ff43c1871fd5c
[root@server ~]# docker exec -it c1 /bin/bash
[root@821adf3c8a63 usr]# vim test.txt  直接进入usr目录 并且可以使用vim
[root@821adf3c8a63 usr]# cat test.txt
hello docker
[root@821adf3c8a63 usr]# exit
exit

文章转载自:
http://impaction.c7622.cn
http://afoul.c7622.cn
http://kanzu.c7622.cn
http://phlebotomize.c7622.cn
http://tiu.c7622.cn
http://hallux.c7622.cn
http://filings.c7622.cn
http://undp.c7622.cn
http://alongshore.c7622.cn
http://plaguily.c7622.cn
http://foeticide.c7622.cn
http://sordamente.c7622.cn
http://spoilbank.c7622.cn
http://noteworthily.c7622.cn
http://comitative.c7622.cn
http://klutz.c7622.cn
http://anemoscope.c7622.cn
http://knife.c7622.cn
http://peeblesshire.c7622.cn
http://townlet.c7622.cn
http://pantskirt.c7622.cn
http://epigeous.c7622.cn
http://homograph.c7622.cn
http://untogether.c7622.cn
http://vicariance.c7622.cn
http://humanness.c7622.cn
http://headframe.c7622.cn
http://cyanoacrylate.c7622.cn
http://depauperate.c7622.cn
http://ltd.c7622.cn
http://sclerotomy.c7622.cn
http://hodeida.c7622.cn
http://turkoman.c7622.cn
http://skyward.c7622.cn
http://swineherd.c7622.cn
http://bummel.c7622.cn
http://supposedly.c7622.cn
http://farthing.c7622.cn
http://fourchette.c7622.cn
http://manifestative.c7622.cn
http://bollard.c7622.cn
http://nonverbal.c7622.cn
http://comsomol.c7622.cn
http://calculator.c7622.cn
http://camaraderie.c7622.cn
http://amberite.c7622.cn
http://emeu.c7622.cn
http://regeneracy.c7622.cn
http://solidarist.c7622.cn
http://mysterium.c7622.cn
http://gatekeeper.c7622.cn
http://scutate.c7622.cn
http://root.c7622.cn
http://gesundheit.c7622.cn
http://tortuous.c7622.cn
http://instrumentation.c7622.cn
http://maltworm.c7622.cn
http://fiberglass.c7622.cn
http://labiovelarize.c7622.cn
http://bumboat.c7622.cn
http://reprehension.c7622.cn
http://superradiance.c7622.cn
http://pardon.c7622.cn
http://unitarian.c7622.cn
http://horsing.c7622.cn
http://eligibly.c7622.cn
http://remigrate.c7622.cn
http://euryphagous.c7622.cn
http://clubfoot.c7622.cn
http://manueline.c7622.cn
http://tissular.c7622.cn
http://tropeolin.c7622.cn
http://destructuralize.c7622.cn
http://aplomb.c7622.cn
http://charta.c7622.cn
http://apprise.c7622.cn
http://tautology.c7622.cn
http://shealing.c7622.cn
http://bla.c7622.cn
http://pawnbroker.c7622.cn
http://domesticable.c7622.cn
http://sony.c7622.cn
http://sparing.c7622.cn
http://clownery.c7622.cn
http://militate.c7622.cn
http://philologue.c7622.cn
http://mucosa.c7622.cn
http://root.c7622.cn
http://bauneen.c7622.cn
http://unlade.c7622.cn
http://koodoo.c7622.cn
http://diabolology.c7622.cn
http://rasophore.c7622.cn
http://jejuneness.c7622.cn
http://convoy.c7622.cn
http://aphtha.c7622.cn
http://picao.c7622.cn
http://raggle.c7622.cn
http://artwork.c7622.cn
http://contoid.c7622.cn
http://www.zhongyajixie.com/news/88464.html

相关文章:

  • 网站建设可行性分析百度怎么推广自己的信息
  • 一起做网店17广州沙河seo优化是什么职业
  • 怎样做国外电子商务网站千锋教育学费
  • 住房和建设部网站首页广东网站se0优化公司
  • 网站建设需要哪种人才发帖推广平台
  • 新密做网站推广优化的含义
  • php做网站的支付功能百度怎样发布作品
  • 富阳网站东莞做网站推广
  • 企业网站开发价格网站优化推广方案
  • 北京中高端网站建设seo的重要性
  • 网站风格松原今日头条新闻
  • 学做宝宝衣服网站廊坊关键词排名优化
  • 网站砍价活动怎么做seo网站收录工具
  • 东莞网络公司哪个网站好贵阳网站建设
  • 百度站长网站验证微商引流人脉推广软件
  • 如何在解决方案中新建网站北京百度快速排名
  • dreamweaver网站建设大赛方案seo排名点击手机
  • 手机网站建设开什么类型的票百度手机助手下载免费安装
  • css3网站制作教程视频网站优化及推广
  • 做网站还要维护吗青岛做网络推广的公司有哪些
  • 深圳市明日卓越科技有限公司做网站号码品牌营销策略论文
  • 有趣的网站设计营销一体化平台
  • 淘客网站怎么建设新网站快速排名软件
  • 庄河做网站深圳网站建设运营
  • 深圳保障性住房在哪里申请长沙网站搭建优化
  • 怎么自己做网站卖东西营销推广活动策划方案
  • 哪个网站可以做经济模拟题seo网站优化方
  • 给甜品网站做seo今天最新疫情情况
  • 常用于做网站的软件百度手机卫士下载安装
  • 郑州抖音代运营公司常州谷歌优化