OpenResty安装失败, context deadline exceeded 自定义安装解决

1Panel版本v2.0.4
OpenResty 版本1.27.1.2-2-1-focal

  1. 准备 安装需要的的软件包或镜像
  2. 下载软件包 openresty-1.27.1.2-2-1-focal.tar.gz 下载地址 https://apps-assets.fit2cloud.com/stable/1panel/openresty/1.27.1.2-2-1-focal/openresty-1.27.1.2-2-1-focal.tar.gz
  3. 通过终端 拉取运行镜像容器 docker run -d --name openresty -p 80:80 -p 443:443 1panel/openresty:1.27.1.2-2-1-focal
  4. 在应用商店安装 OpenResty 失败后不要卸载 进入安装目录中 /opt/1panel/apps/openresty/openresty 如果无 安装此目录逐层新建文件夹
  5. 解压出openresty-1.27.1.2-2-1-focal.tar.gz 的文件放入 /opt/1panel/apps/openresty/openresty 如图

其中 .env文件内容如下
RESTY_CONFIG_OPTIONS_MORE=“”
RESTY_ADD_PACKAGE_BUILDDEPS=“”
CONTAINER_PACKAGE_URL=“”
CONTAINER_NAME=“openresty”
WEBSITE_DIR=“/opt/1panel/www”

和拉取镜像容器名–name openresty 保持一致 (docker run -d --name openresty -p 80:80 -p 443:443 1panel/openresty:1.27.1.2-2-1-focal )

其中docker-compose.yml内容如下 注意缩进
services:
openresty:
build:
context: ./build
args:
- PANEL_OPENRESTY_VERSION=1.27.1.2-2-1-focal
- RESTY_CONFIG_OPTIONS_MORE=${RESTY_CONFIG_OPTIONS_MORE}
- RESTY_ADD_PACKAGE_BUILDDEPS=${RESTY_ADD_PACKAGE_BUILDDEPS}
- CONTAINER_PACKAGE_URL=${CONTAINER_PACKAGE_URL}
image: 1panel/openresty:1.27.1.2-2-1-focal
container_name: ${CONTAINER_NAME}
restart: always
network_mode: host
ports:
- 80:80
- 443:443
volumes:
- ./conf/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf
- ./conf/fastcgi_params:/usr/local/openresty/nginx/conf/fastcgi_params
# - ./conf/fastcgi-php.conf:/usr/local/openresty/nginx/conf/fastcgi-php.conf
- ./conf/mime.types:/usr/local/openresty/nginx/conf/mime.types
- ./conf/default:/usr/local/openresty/nginx/conf/default/
- ./conf/ssl:/usr/local/openresty/nginx/conf/ssl/
- ./log:/var/log/nginx
- ./root:/usr/share/nginx/html
- /etc/localtime:/etc/localtime
- ./1pwaf/data:/usr/local/openresty/1pwaf/data
- ${WEBSITE_DIR}:/www
- ${WEBSITE_DIR}/conf.d:/usr/local/openresty/nginx/conf/conf.d/
labels:
createdBy: “Apps”

以上操作完成后 进入应用商店 已安装 点击 重建