【Azure 应用服务】更新镜像后并重启应用服务,部署日志始终没有出现加载新镜像成功的日志
问题描述
在App Service中部署镜像文件,发现镜像一直没有部署,重启App Service服务也无效果。
DockerFile如下:
FROM crunchgeek/php-fpm:7.0 # 设置时区
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone # apt 安装supervisor nginx python-pip
RUN sed -i "s@http://deb.debian.org@http://mirrors.aliyun.com@g" /etc/apt/sources.list \
&& apt-get clean && apt-get update
RUN apt-get install -y openssh-server supervisor nginx python-pip imagemagick
RUN pip install -i https://mirrors.aliyun.com/pypi/simple XlsxWriter # 开启ssh
RUN echo "root:Docker!" | chpasswd
COPY conf/ssh/sshd_config /etc/ssh/
RUN mkdir -p /tmp
COPY conf/ssh/ssh_setup.sh /tmp
RUN chmod +x /tmp/ssh_setup.sh \
&& (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) # 配置supervisor
RUN mkdir -p /var/log/supervisor
COPY conf/supervisor/supervisord.conf /etc/supervisor/supervisord.conf # 配置nginx
RUN mkdir -p /var/log/nginx
COPY conf/nginx/nginx.conf /etc/nginx/nginx.conf
COPY conf/nginx/phpdemotest.conf /etc/nginx/conf.d/phpdemotest.conf # 配置php
RUN mkdir -p /var/log/php
COPY conf/php/php.ini /usr/local/etc/php/php.ini
COPY conf/php/www.conf /usr/local/etc/php-fpm.d/www.conf # 暴露端口
EXPOSE 80
EXPOSE 2222 # 处理项目文件
WORKDIR /
COPY app /app
RUN mkdir -p /app/phpdemotest/cache && mkdir -p /app/phpdemotest/uploads
RUN chmod -R 777 /app # 启动脚本
COPY run.sh /run.sh
RUN chmod +x /run.sh
ENTRYPOINT ["/run.sh"]
在App Service的 Default Docker 日志文件中发现错误:
2022-02-06T23:59:17.443332417Z + /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
2022-02-06T23:59:17.443373922Z + /usr/sbin/sshd
2022-02-06T23:59:18.452607133Z 2022-02-07 07:59:18,452 CRIT Supervisor running as root (no user in config file)
2022-02-06T23:59:18.456877344Z 2022-02-07 07:59:18,456 INFO supervisord started with pid 8
2022-02-06T23:59:19.465631733Z 2022-02-07 07:59:19,463 INFO spawned: 'nginx' with pid 12
2022-02-06T23:59:19.466909186Z 2022-02-07 07:59:19,466 INFO spawned: 'php-fpm' with pid 13
2022-02-06T23:59:19.494100139Z 2022-02-07 07:59:19,493 INFO exited: nginx (exit status 1; not expected)
2022-02-06T23:59:20.857528223Z 2022-02-07 07:59:20,853 INFO spawned: 'nginx' with pid 31
2022-02-06T23:59:20.857568522Z 2022-02-07 07:59:20,854 INFO success: php-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-02-06T23:59:20.870432633Z 2022-02-07 07:59:20,870 INFO exited: nginx (exit status 1; not expected)
2022-02-06T23:59:22.879193415Z 2022-02-07 07:59:22,878 INFO spawned: 'nginx' with pid 32
2022-02-06T23:59:22.893106810Z 2022-02-07 07:59:22,892 INFO exited: nginx (exit status 1; not expected)
2022-02-06T23:59:25.913145415Z 2022-02-07 07:59:25,907 INFO spawned: 'nginx' with pid 33
2022-02-06T23:59:25.922158533Z 2022-02-07 07:59:25,921 INFO exited: nginx (exit status 1; not expected)
2022-02-06T23:59:26.927725113Z 2022-02-07 07:59:26,927 INFO gave up: nginx entered FATAL state, too many start retries too quickly 2022-02-07T00:09:25.488220881Z + /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
2022-02-07T00:09:25.488718279Z + /usr/sbin/sshd
2022-02-07T00:09:26.467977299Z 2022-02-07 08:09:26,467 CRIT Supervisor running as root (no user in config file)
2022-02-07T00:09:26.471996285Z 2022-02-07 08:09:26,471 INFO supervisord started with pid 8
2022-02-07T00:09:27.477601588Z 2022-02-07 08:09:27,475 INFO spawned: 'nginx' with pid 12
2022-02-07T00:09:27.479159791Z 2022-02-07 08:09:27,478 INFO spawned: 'php-fpm' with pid 13
2022-02-07T00:09:27.504344436Z 2022-02-07 08:09:27,504 INFO exited: nginx (exit status 1; not expected)
2022-02-07T00:09:28.696030787Z 2022-02-07 08:09:28,695 INFO spawned: 'nginx' with pid 31
2022-02-07T00:09:28.696917389Z 2022-02-07 08:09:28,696 INFO success: php-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-02-07T00:09:28.709830112Z 2022-02-07 08:09:28,709 INFO exited: nginx (exit status 1; not expected)
2022-02-07T00:09:30.721563220Z 2022-02-07 08:09:30,718 INFO spawned: 'nginx' with pid 32
2022-02-07T00:09:30.733000942Z 2022-02-07 08:09:30,732 INFO exited: nginx (exit status 1; not expected)
2022-02-07T00:09:33.753600087Z 2022-02-07 08:09:33,750 INFO spawned: 'nginx' with pid 33
2022-02-07T00:09:33.770204819Z 2022-02-07 08:09:33,769 INFO exited: nginx (exit status 1; not expected)
2022-02-07T00:09:33.771144421Z 2022-02-07 08:09:33,770 INFO gave up: nginx entered FATAL state, too many start retries too quickly 2022-02-07T00:18:34.847730464Z + /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
2022-02-07T00:18:34.852556800Z + /usr/sbin/sshd
2022-02-07T00:18:35.682198497Z 2022-02-07 08:18:35,681 CRIT Supervisor running as root (no user in config file)
2022-02-07T00:18:35.685920425Z 2022-02-07 08:18:35,685 INFO supervisord started with pid 8
2022-02-07T00:18:36.693576944Z 2022-02-07 08:18:36,691 INFO spawned: 'nginx' with pid 12
2022-02-07T00:18:36.695261854Z 2022-02-07 08:18:36,694 INFO spawned: 'php-fpm' with pid 13
2022-02-07T00:18:36.720480795Z 2022-02-07 08:18:36,720 INFO exited: nginx (exit status 1; not expected)
2022-02-07T00:18:37.903152006Z 2022-02-07 08:18:37,898 INFO spawned: 'nginx' with pid 31
2022-02-07T00:18:37.905742221Z 2022-02-07 08:18:37,903 INFO success: php-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-02-07T00:18:37.920186002Z 2022-02-07 08:18:37,919 INFO exited: nginx (exit status 1; not expected)
2022-02-07T00:18:39.933674870Z 2022-02-07 08:18:39,930 INFO spawned: 'nginx' with pid 32
2022-02-07T00:18:39.942568331Z 2022-02-07 08:18:39,942 INFO exited: nginx (exit status 1; not expected)
2022-02-07T00:18:42.961585686Z 2022-02-07 08:18:42,955 INFO spawned: 'nginx' with pid 33
2022-02-07T00:18:42.973046638Z 2022-02-07 08:18:42,972 INFO exited: nginx (exit status 1; not expected)
2022-02-07T00:18:42.974184633Z 2022-02-07 08:18:42,973 INFO gave up: nginx entered FATAL state, too many start retries too quickly
问题解答
从错误消息中发现,是 Nginx启动时候遇见错误 “ nginx entered FATAL state, too many start retries too quickly”。 最后发现是Nginx.config配置文件中格式错误,在修改后发布镜像后,App Service确没有拉取新的镜像,所以没有新镜像的部署日志。
这是因为App Service没有开启持续部署,当开启持续部署后,App Service会主动拉取最新的更新并自动完成部署。

PS: 当遇见镜像无法启动时,先在本地环境中验证镜像是否能成功启动,然后查看App Service的日志,从日志中定位具体问题。
参考资料
持续部署到 Azure 应用服务:https://docs.azure.cn/zh-cn/app-service/deploy-continuous-deployment?tabs=local
【Azure 应用服务】更新镜像后并重启应用服务,部署日志始终没有出现加载新镜像成功的日志的更多相关文章
- python通过重启线程,实现服务的热加载
这个思路后来证明不能用于工作. 因为线程调用没有及时返回,所以不能用这种方式来重启服务. 但作为脑洞,也应该作个记录. import os import shutil import datetime ...
- Centos系统创建用户oracle后,用该用户登陆系统,页面加载报错GConf error
Linux 的 GConf error 解决办法 问题: Centos系统创建用户oracle后,用该用户登陆系统,页面加载报错,导致重新进入Centos系统后出现: GConf error:Fail ...
- Android系统定制——Download Android System 及加载system镜像文件
定制android系统(配置及相关系统的镜像文件),具体可参考:Driver_All_in_One_V1.0——MT6735_6753.pdf文档,特别需要理解的是Download部分. 与之对应的软 ...
- 骚操作:不重启 JVM,如何替换掉已经加载的类?
Java对象行为 java.lang.instrument.Instrumentation 直接操作字节码 BTrace Arthas 三生万物 在遥远的希艾斯星球爪哇国塞沃城中,两名年轻的程序员正在 ...
- nginx设置反向代理后,页面上的js css文件无法加载
问题现象: nginx配置反向代理后,网页可以正常访问,但是页面上的js css文件无法加载,页面样式乱了. (1)nginx配置如下: (2)域名访问:js css文件无法加载: (3)IP访问:j ...
- IDEA导出jar包后运行报错 找不到或无法加载主类
开发工具:IDEA16 运行环境:ubuntu 问题:根据网上的Idea导出jar包的方法,将我的项目导出jar包后运行报错:找不到或无法加载主类. 为了找到这个原因,我重新搭建了一个测试例子,在 ...
- linux如何离线加载docker镜像?
1. 在已经部署了镜像的机器上获取镜像 1.1 获取镜像名 docker images 1.2 打包选中对应的镜像 docker save <image_name> -o <imag ...
- [Jenkins]初次访问Jenkins,输入密码后,页面卡在空白界面一直未加载出内容_解决方案
问题描述 安装Jenkins,初次访问Jenkins(http://localhost:8002,端口号根据各自设置而不同,本例是8002),输入Jenkins初始化的管理密码之后,浏览器中一直卡在空 ...
- intellij IDEA 更新java后不用重启tomcat
最近项目大了,每次修改后重启都要等和很久,那个煎熬…… 为了解决这个问题,万能的Google 装了这个 JREBEL 5.63最新的 安装步骤: 一.IDEA在线搜索 jrebel 安装 二.破 ...
- 线上代码已变更,客户没有刷新浏览器,导致点击菜单后找不到相对路由js文件无法加载XXX路由,解决办法如下
1,reload 方法,该方法强迫浏览器刷新当前页面. 语法:location.reload([bForceGet]) 参数: bForceGet, 可选参数, 默认为 false,从客户端缓存里取当 ...
随机推荐
- 【K哥爬虫普法】12亿公民信息泄露,仅判3年,个人信息是否为爬虫“禁区”?
我国目前并未出台专门针对网络爬虫技术的法律规范,但在司法实践中,相关判决已屡见不鲜,K 哥特设了"K哥爬虫普法"专栏,本栏目通过对真实案例的分析,旨在提高广大爬虫工程师的法律意识, ...
- STM32CubeMX教程26 FatFs 文件系统 - W25Q128读写
1.准备材料 正点原子stm32f407探索者开发板V2.4 STM32CubeMX软件(Version 6.10.0) keil µVision5 IDE(MDK-Arm) ST-LINK/V2驱动 ...
- gpedit.msc 打不开
win10系统推出已有不短的时间了,朋友们也纷纷升级了win10系统,但是暴露的问题也是越来越多,比如win10系统打开运行输入gpedit.msc命令时却提示找不到文件.那出现win10打不开gpe ...
- 安装Docker填坑
从官网下载适合win10使用的docker,但是下载后,出现了各种坑,记录一下解决方式 1.docker想要正常启动,需要做以下的准备,开启 Windows 虚拟化和 Linux 子系统(WSL2), ...
- go中string是如何实现的呢
go中string是如何实现的呢 前言 实现 go语言中的string是不可变的 []byte转string string转[]byte 字符串的拼接 +方式进行拼接 fmt 拼接 Join 拼接 b ...
- 从零开始构建一个电影知识图谱,实现KBQA智能问答[下篇]:Apache jena SPARQL endpoint及推理、KBQA问答Demo超详细教学
从零开始构建一个电影知识图谱,实现KBQA智能问答[下篇]:Apache jena SPARQL endpoint及推理.KBQA问答Demo超详细教学 效果展示: 1.Apache jena SPA ...
- MySQL创建, 修改,删除用户密码
MySQL创建, 修改,删除用户密码 创建用新户名密码 创建用新户名密码: create user 'test1'@'localhost' identified by 'test1'; 修改用户名密码 ...
- P9816 少项式复合幂 题解
题目链接:少项式复合幂 注意到题目的模并不是很大,我们考虑两个核心的性质. \(f(f(x)) \bmod p=f(f(x) \bmod p) \bmod p\),证明直接代入 \(f(x)\) 进去 ...
- Mygin之错误恢复Recover中间件
本篇是mygin这个系列的最后一篇.如果想自己动手实现一个类似Gin的Web框架,建议从 mgin第一篇开始, 总代码行数有效行数只有600多行 github源码 mygin 目的 实现错误处理机制 ...
- Python中的UnboundLocalError是什么错误?如何解决?
在一个月黑风高的夜晚,我们满心欢喜地写出以下代码: money = 10000 # 当前的财产,单位为元 def add_money(value): money += value print('当 ...