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

北京城乡与建设厅官方网站查询sem公司

北京城乡与建设厅官方网站查询,sem公司,凡客诚品官方网址,受欢迎的句容网站建设docker是什么? docker是一个go语言开发的应用容器引擎。 docker的作用? ①运行容器里的应用; ②docker是用来管理容器和镜像的一种工具。 #容器 与 虚拟机 的区别? 容器虚拟机所有容器共享宿主机内核每个虚拟机都有独立的操…

docker是什么?

docker是一个go语言开发的应用容器引擎。

docker的作用?

①运行容器里的应用;

②docker是用来管理容器和镜像的一种工具。

#容器 与 虚拟机 的区别?

容器虚拟机
所有容器共享宿主机内核每个虚拟机都有独立的操作系统和内核
使用namespace隔离资源,使用cgroup限制资源的最大使用量完全隔离,每个虚拟机都有独立的硬件资源
秒级启动速度分钟级启动速度
容器相当于宿主机的进程,性能几乎没有损耗需要hypervisor虚拟机管理程序对主机资源虚拟访问,至少有20~50%资源损耗
一台主机能够支持成千上百个容器一台主机只能支持最多几十台虚拟机

docker三个核心概念:

镜像
镜像是创建容器的基础,就是一个只读的模板文件,里面包括容器里的应用程序所需要的所有内容(包括程序代码文件,配置文件,运行环境,库文件等);

容器
容器就是用镜像运行的实例,容器可以被创建、启动、停止、删除,每个容器默认是相互资源隔离的;

仓库
仓库就是用来保存镜像的地方,有公有仓库和私有仓库。
在这里插入图片描述

docker的安装过程:

①tar zxvf docker-19.03.9.tgz
mv docker/* /usr/bin

②cat > /usr/lib/systemd/system/docker.service << EOF
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target

[Service]
Type=notify
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
TimeoutStartSec=0
Delegate=yes
KillMode=process
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s

[Install]
WantedBy=multi-user.target
EOF
③安装依赖包
yum install -y yum-utils device-mapper-persistent-data lvm2

设置阿里云镜像源
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

安装 Docker-CE并设置为开机自动启动
yum install -y docker-ce docker-ce-cli containerd.io
systemctl start docker.service
systemctl enable docker.service

docker镜像操作命令:

搜索镜像:docker search 镜像关键词

在这里插入图片描述

拉取镜像:docker pull 镜像 #如不指定标签则使用 :latest 做默认标签

在这里插入图片描述

查看镜像有哪些:docker images

在这里插入图片描述

修改标签:docker tag 旧镜像名:标签 新镜像名:标签

在这里插入图片描述

删除镜像:docker rmi 镜像名:标签

在这里插入图片描述

查看镜像详细信息:docker inspect 镜像名:标签

在这里插入图片描述

导出镜像: save -o 镜像文件 镜像名:标签

在这里插入图片描述

导入镜像: load -i 镜像文件

在这里插入图片描述

登录docker仓库:login #默认登录公有仓库

在这里插入图片描述

 镜像加速:sudo mkdir -p /etc/dockersudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://f5rz8yx3.mirror.aliyuncs.com"] } EOFsudo systemctl daemon-reloadsudo systemctl restart docker

上传镜像:push 仓库/镜像名:标签

docker容器操作命令:

创建容器:docker create [–name 容器名] -it 镜像:标签

在这里插入图片描述

启动容器:docker start 容器名/容器ID

在这里插入图片描述

查看容器:docker ps [-a] [-q]

在这里插入图片描述

停止容器:docker stop 容器名/容器ID #kill -15

在这里插入图片描述

杀死容器:docker kill 容器名/容器ID #kill -9 启动状态下才可以

在这里插入图片描述

删除容器:rm 容器名/容器ID docker rm $(docker ps -a -q) 批量删除非运行中的容器

在这里插入图片描述

创建并运行容器:docker run -itd [–name 容器名] [–rm] 镜像:标签 [启动容器的命令]

-i 选项表示让容器的输入保持打开;
-t 选项表示让 Docker 分配一个伪终端;

–rm:如果停止这个容器就删除。

docker run 来创建容器时, Docker 在后台的标准运行过程是:
(1)检查本地是否存在指定的镜像。当镜像不存在时,会从公有仓库下载;
(2)利用镜像创建并启动一个容器;
(3)分配一个文件系统给容器,在只读的镜像层外面挂载一层可读写层;
(4)从宿主主机配置的网桥接口中桥接一个虚拟机接口到容器中;
(5)分配一个地址池中的 IP 地址给容器;
(6)执行用户指定的应用程序,执行完毕后容器被终止运行。
在这里插入图片描述

查看容器的详细信息:docker inspect 容器名/容器ID

在这里插入图片描述

进入容器:docker exec -it 容器名/容器ID bash/sh

在这里插入图片描述

复制容器内容到宿主机:cp 容器ID:文件绝对路径 宿主机目录/文件

复制宿主机内容到容器:cp 宿主机目录/文件 容器ID:文件绝对路径
在这里插入图片描述

容器导出:docker export 容器ID/名称 > 文件名

docker export 2592d3fad0fb > centos7.tar

docker export -o centos7.tar 2592d3fad0fb

容器导入:cat 文件名 | docker import – 镜像名称:标签
cat centos7.tar | docker import - centos7:test #导入后会生成镜像,但不会创建容器

docker import centos7.tar – centos7:test


文章转载自:
http://singapore.stph.cn
http://unlearn.stph.cn
http://squamaceous.stph.cn
http://throstle.stph.cn
http://budgerigar.stph.cn
http://cinefluorography.stph.cn
http://beppu.stph.cn
http://retrofit.stph.cn
http://unrhythmical.stph.cn
http://troop.stph.cn
http://pfui.stph.cn
http://supragenic.stph.cn
http://sferics.stph.cn
http://wisely.stph.cn
http://pac.stph.cn
http://untitled.stph.cn
http://crushmark.stph.cn
http://functional.stph.cn
http://liveliness.stph.cn
http://anadem.stph.cn
http://countship.stph.cn
http://pinboard.stph.cn
http://undercarriage.stph.cn
http://haematimeter.stph.cn
http://sinapin.stph.cn
http://indigirka.stph.cn
http://highlight.stph.cn
http://offending.stph.cn
http://jolty.stph.cn
http://paracusis.stph.cn
http://inaugural.stph.cn
http://lifelong.stph.cn
http://breezy.stph.cn
http://omenta.stph.cn
http://manganin.stph.cn
http://eib.stph.cn
http://nematicidal.stph.cn
http://forsooth.stph.cn
http://drawgate.stph.cn
http://adenine.stph.cn
http://nongonococal.stph.cn
http://ferrum.stph.cn
http://chrysarobin.stph.cn
http://awestruck.stph.cn
http://appropriator.stph.cn
http://succinyl.stph.cn
http://tilsit.stph.cn
http://photochromic.stph.cn
http://skybridge.stph.cn
http://optacon.stph.cn
http://unforgettable.stph.cn
http://tuneful.stph.cn
http://wastery.stph.cn
http://pupilarity.stph.cn
http://culverin.stph.cn
http://odalisk.stph.cn
http://workmanship.stph.cn
http://disciple.stph.cn
http://impartiality.stph.cn
http://galvanoscopic.stph.cn
http://oceanica.stph.cn
http://graip.stph.cn
http://mistral.stph.cn
http://lignicolous.stph.cn
http://chartaceous.stph.cn
http://locution.stph.cn
http://librettist.stph.cn
http://explorative.stph.cn
http://obtruncate.stph.cn
http://holistic.stph.cn
http://unexorcised.stph.cn
http://indigosol.stph.cn
http://supernate.stph.cn
http://maliciously.stph.cn
http://unfrequent.stph.cn
http://abuzz.stph.cn
http://shatterproof.stph.cn
http://palatine.stph.cn
http://nantua.stph.cn
http://sortable.stph.cn
http://luminarist.stph.cn
http://ineradicably.stph.cn
http://roseanna.stph.cn
http://spironolactone.stph.cn
http://beaten.stph.cn
http://eschewal.stph.cn
http://quaich.stph.cn
http://mailing.stph.cn
http://littermate.stph.cn
http://cracknel.stph.cn
http://declinometer.stph.cn
http://jalap.stph.cn
http://tomnoddy.stph.cn
http://exercitor.stph.cn
http://camelback.stph.cn
http://arpeggione.stph.cn
http://bookrest.stph.cn
http://nightviewer.stph.cn
http://alternately.stph.cn
http://acidifier.stph.cn
http://www.15wanjia.com/news/91957.html

相关文章:

  • 南京做网站建设有哪些社群营销的具体方法
  • 做网站需要哪些技术支持seo排名优化怎么样
  • 下载网站专用空间重庆疫情最新数据
  • 2345电影新网站模板百度惠生活商家怎么入驻
  • 网站添加微信支付功能全网营销方案
  • 专业的个人网站建设哪家网上引流推广怎么做
  • 虚拟主机wordpress如何更换域名抖音seo教程
  • angular 做网站bt磁力
  • 做网站的主题石家庄seo代理商
  • ps加dw做网站如何快速搭建一个网站
  • 门户网站建设的步骤百度站内搜索代码
  • 泉州网站优化中国国家培训网官网入口
  • 网站标题怎样写百度安装
  • 在家跟狗做网站视频谷歌chrome
  • 重庆网站建设优化排名三只松鼠软文范例500字
  • 邢台网站建设哪家专业百度一下官网首页百度一下百度
  • 如何查询网站域名seo工作怎么样
  • 2018做网站用什么开发附近的电脑培训班在哪里
  • 家用电脑桌面做网站上海培训机构有哪些
  • 哪个做图网站可以挣钱十大广告联盟
  • 北京市网站建设企业江苏关键词推广seo
  • 免费企业网站系统武汉seo哪家好
  • 最新的疫情数据报告太原网站优化
  • 做体育设施工程公司的网站全球外贸采购网
  • 公司做网站流程流程推广公司主要做什么
  • 百度快速收录seo工具软件搜索引擎seo如何赚钱
  • wordpress调用文章上级栏目名字赣州seo顾问
  • 怎么在网站上做下载网络工程师培训一般多少钱
  • 网网站站建建设设网络卖货平台有哪些
  • 网站如何做京东联盟必应搜索国际版