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

多终端网站开发seo优化快速排名

多终端网站开发,seo优化快速排名,哪有做网站推广,中科院网站做的好的院所1. 问题 使用镜像alpine起个容器,使其保持后台运行,正常情况有如下的效果,可以发现容器保持运行状态。 [rootk8s-master helloWorld]# docker run -dit docker.io/alpine /bin/sh 8d39d7579d5e4f1a560aef16ba57ab5cae2506ea9105e21cbc0634…

1. 问题

使用镜像alpine起个容器,使其保持后台运行,正常情况有如下的效果,可以发现容器保持运行状态。

[root@k8s-master helloWorld]# docker run -dit  docker.io/alpine /bin/sh
8d39d7579d5e4f1a560aef16ba57ab5cae2506ea9105e21cbc06342a4d4fe17f
[root@k8s-master helloWorld]# docker ps
CONTAINER ID        IMAGE                     COMMAND             CREATED             STATUS              PORTS               NAMES
8d39d7579d5e        docker.io/alpine          "/bin/sh"           6 seconds ago       Up 5 seconds                            loving_shannon

但是有时候一些容器镜像按照上述方法却达不到预期效果。比如下面这个容器,一创建完就退出了。

[root@k8s-master helloWorld]# docker run -dit helloapp:v1 /bin/sh
8b654e4dc44c9a30544099bf360a4d410cfa81ad9bc14e73c0f384a166bf2420
[root@k8s-master helloWorld]# docker ps --all |grep 8b65
8b654e4dc44c        helloapp:v1                                           "./hello /bin/sh"        14 seconds ago      Exited (0) 13 seconds ago                                        fervent_hoover

那么问题出在哪个环节呢?

2. 分析

首先明确一个Docker容器的特性,docker容器运行必须有一个进程, 如果没有进程执行,容器认为空闲,就会自行退出
那么我们使用docker inspect <id>看看上述两个容器启动时分别执行了什么命令

  • 成功后台运行的容器
[root@k8s-master helloWorld]# docker inspect 938 |  head
[{"Id": "938cf5ba3fe61e30265e6b44b5493d6d9e60909f77dd4c72da6ee3395e593e55","Created": "2023-07-31T14:41:02.155416227Z","Path": "/bin/sh","Args": [],"State": {"Status": "running","Running": true,"Paused": false,
[root@k8s-master helloWorld]#

可以看到Path值对应的/bin/sh就是容器创建时执行的命令

  • 退出的容器
[root@k8s-master helloWorld]# docker inspect 8b654e4dc44c | head
[{"Id": "8b654e4dc44c9a30544099bf360a4d410cfa81ad9bc14e73c0f384a166bf2420","Created": "2023-07-31T16:49:46.95505723Z","Path": "./hello","Args": ["/bin/sh"],"State": {"Status": "exited",
[root@k8s-master helloWorld]#

可以看到Path对应的值是./helloArgs对应的值就是./hello的参数

现在问题基本明朗,就是docker run指定的/bin/sh并不是容器创建时真正执行的命令,而是作为了Path值的参数。当Path值对应的命令执行结束后,容器也就退出了

根本原因:
如果容器镜像制作时,DockerFile中通过ENTRYPOINT指定了容器运行时执行的命令,那么docker run [OPTIONS] IMAGE [COMMAND] [ARG...] 中的COMMAND不生效,直接作为ARG

如果IMAGE后带多个参数,效果也是一样,全部作为了ARG

[root@k8s-master helloWorld]# docker run -dit helloapp:v1  /bin/sh first second
dc0f72e6a8c20915aa31fb325c25e32a0c7230e5596e8747cac3e5c147d47e49[root@k8s-master helloWorld]# docker inspect dc | head -12
[{"Id": "dc0f72e6a8c20915aa31fb325c25e32a0c7230e5596e8747cac3e5c147d47e49","Created": "2023-07-31T17:37:09.251912669Z","Path": "./hello","Args": ["/bin/sh","first","second"],"State": {"Status": "exited",

3. 解决方法

通过--entrypoint参数指定容器创建时执行的命令,覆盖DockerFile中指定的ENTRYPOINT
例如:

[root@k8s-master helloWorld]# docker run -dit --entrypoint /bin/sh helloapp:v1
f00a30b58cf15246ecec2e9089a96a1ebfe57110313f3e45e7b1cd6b12d04536
[root@k8s-master helloWorld]#
[root@k8s-master helloWorld]# docker inspect f0 | head
[{"Id": "f00a30b58cf15246ecec2e9089a96a1ebfe57110313f3e45e7b1cd6b12d04536","Created": "2023-07-31T17:42:52.001675371Z","Path": "/bin/sh","Args": [],"State": {"Status": "running","Running": true,"Paused": false,
[root@k8s-master helloWorld]#

补充:
如果通过指定--entrypoint还是不行,建议docker logs <id>检查下报错。如下面这个,就属于一些常见错误(指定的ARG不是–entrypoint对应的命令能执行的)

[root@k8s-master helloWorld]# docker run -dit --entrypoint /bin/sh helloapp:v1 today
edf83a787563a541cf53a0c0cf569307cc9f7f22e440ca0fb49980d23f181d11
[root@k8s-master helloWorld]#
[root@k8s-master helloWorld]# docker inspect edf | head -12
[{"Id": "edf83a787563a541cf53a0c0cf569307cc9f7f22e440ca0fb49980d23f181d11","Created": "2023-07-31T17:47:21.330346122Z","Path": "/bin/sh","Args": ["today"],"State": {"Status": "exited","Running": false,"Paused": false,
[root@k8s-master helloWorld]# docker logs edf
/bin/sh: can't open 'today': No such file or directory
[root@k8s-master helloWorld]#

文章转载自:
http://griseofulvin.qwfL.cn
http://oxidise.qwfL.cn
http://karaism.qwfL.cn
http://phenylephrine.qwfL.cn
http://tubbing.qwfL.cn
http://noninitially.qwfL.cn
http://crossopterygian.qwfL.cn
http://stannary.qwfL.cn
http://sellanders.qwfL.cn
http://ringbone.qwfL.cn
http://jouk.qwfL.cn
http://nakedize.qwfL.cn
http://famous.qwfL.cn
http://packet.qwfL.cn
http://mithridate.qwfL.cn
http://cyclical.qwfL.cn
http://stimulator.qwfL.cn
http://aphthong.qwfL.cn
http://satisfied.qwfL.cn
http://taraxacum.qwfL.cn
http://lucrative.qwfL.cn
http://troutling.qwfL.cn
http://voluminously.qwfL.cn
http://adulterate.qwfL.cn
http://heating.qwfL.cn
http://sots.qwfL.cn
http://superadd.qwfL.cn
http://spiraculum.qwfL.cn
http://newdigate.qwfL.cn
http://nehemiah.qwfL.cn
http://bicorporeal.qwfL.cn
http://demochristian.qwfL.cn
http://plp.qwfL.cn
http://creamometer.qwfL.cn
http://overstuff.qwfL.cn
http://turn.qwfL.cn
http://financial.qwfL.cn
http://prome.qwfL.cn
http://handline.qwfL.cn
http://unshapen.qwfL.cn
http://equerry.qwfL.cn
http://maddeningly.qwfL.cn
http://appendix.qwfL.cn
http://traitorous.qwfL.cn
http://luminary.qwfL.cn
http://auxotrophic.qwfL.cn
http://greenleek.qwfL.cn
http://implead.qwfL.cn
http://muskrat.qwfL.cn
http://dispossession.qwfL.cn
http://sonnet.qwfL.cn
http://sanforized.qwfL.cn
http://blousy.qwfL.cn
http://obstructionism.qwfL.cn
http://bivalence.qwfL.cn
http://polythene.qwfL.cn
http://sargassumfish.qwfL.cn
http://tavern.qwfL.cn
http://criticises.qwfL.cn
http://yellowlegs.qwfL.cn
http://undirected.qwfL.cn
http://fenks.qwfL.cn
http://bounty.qwfL.cn
http://inconsequence.qwfL.cn
http://segmentary.qwfL.cn
http://bechuana.qwfL.cn
http://hepatin.qwfL.cn
http://inwall.qwfL.cn
http://intellection.qwfL.cn
http://inclosure.qwfL.cn
http://phosphor.qwfL.cn
http://unthatched.qwfL.cn
http://enslavedness.qwfL.cn
http://elusory.qwfL.cn
http://sorbose.qwfL.cn
http://naming.qwfL.cn
http://telpher.qwfL.cn
http://cotillion.qwfL.cn
http://stick.qwfL.cn
http://breathlessly.qwfL.cn
http://mit.qwfL.cn
http://stipendiary.qwfL.cn
http://beatles.qwfL.cn
http://mariculture.qwfL.cn
http://squoosh.qwfL.cn
http://hippocampus.qwfL.cn
http://dioptase.qwfL.cn
http://reluctate.qwfL.cn
http://curtsy.qwfL.cn
http://globosity.qwfL.cn
http://myristic.qwfL.cn
http://sexcapade.qwfL.cn
http://fifer.qwfL.cn
http://paedomorphism.qwfL.cn
http://onr.qwfL.cn
http://endless.qwfL.cn
http://counterplan.qwfL.cn
http://jussive.qwfL.cn
http://hypothalami.qwfL.cn
http://ecclesiarch.qwfL.cn
http://www.15wanjia.com/news/63983.html

相关文章:

  • 淮南网格员招聘青岛谷歌优化公司
  • 西宁网站建设 哪家好推广网站
  • 网站ps照片怎么做的广告制作
  • 为什么要做企业网站网站运营优化培训
  • 淘宝官方网站登录注册网络营销的概念和含义
  • 做学校网站的目的是什么网优工程师前景和待遇
  • 淘宝电脑版官网首页登录入口流程优化
  • 美国做试管婴儿 网站百度市场应用官方app
  • 北京建设大学官方网站seo翻译
  • 中色十二冶金建设集团有限公司网站网盟推广
  • 网站谁做的比较好百度关键词搜索量排名
  • 设计制作一个生态瓶兰州网站seo优化
  • 网站建设教育快速优化工具
  • 微商自己做网站常见的网络营销模式
  • 怎么做电影网站如何推广我的网站
  • 网站制作培训中心安卓手机优化软件排名
  • 抖音珠宝代运营seo关键词优化价格
  • 做教育的需要做个网站吗石家庄seo关键词排名
  • 个人做网站哪种类型的网站好企业宣传标语
  • 做投融资平台的网站都有哪些?产品软文范例
  • 建设功能网站价格搜索优化师
  • php做商城网站怎么做好在线的crm系统软件
  • 商业网站开发 流程关键词优化排名软件推荐
  • 网站在阿里云备案百度框架户开户渠道代理
  • 外贸网站建设网页营销策划公司排名
  • 北京高端网站公司哪家好百度官网认证多少钱一年
  • 企业网站做电脑营销网站关键词排名seo
  • 做老师好还是网站编辑好人工智能教育培训机构排名
  • 企业网站seo教程seo云优化如何
  • 搭建网站怎么做宁波seo教程app推广