用python:3.10-slim构建后,容器一直restarting #1877
Replies: 1 comment
|
解决方法: 1、构建时要 apt install cron |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
由于Alpine中ddddocr库无法安装,故使用python:3.10-slim构建
docker logs -f qinglong`请先访问5700端口,登录成功面板之后再执行添加定时任务...
############################################################
./docker/docker-entrypoint.sh: line 59: crond: command not found
======================1. 检测配置文件========================
'/ql/docker/nginx.conf' -> '/etc/nginx/nginx.conf'
'/ql/docker/front.conf' -> '/etc/nginx/conf.d/front.conf'
======================2. 安装依赖========================
======================3. 启动nginx========================
nginx启动成功...
======================4. 启动面板监控========================
�[32m[PM2] �[39mStarting /ql/static/build/public.js in fork_mode (1 instance)
�[32m[PM2] �[39mDone.
�[90m┌────┬────────────────────┬──────────┬──────┬───────────┬──────────┬──────────┐�[39m
�[90m│�[39m�[1m�[36m id �[39m�[22m�[90m│�[39m�[1m�[36m name �[39m�[22m�[90m│�[39m�[1m�[36m mode �[39m�[22m�[90m│�[39m�[1m�[36m ↺ �[39m�[22m�[90m│�[39m�[1m�[36m status �[39m�[22m�[90m│�[39m�[1m�[36m cpu �[39m�[22m�[90m│�[39m�[1m�[36m memory �[39m�[22m�[90m│�[39m
�[90m├────┼────────────────────┼──────────┼──────┼───────────┼──────────┼──────────┤�[39m
�[90m│�[39m�[1m�[36m �[1m�[36m0�[39m�[36m�[22m�[1m �[39m�[22m�[90m│�[39m public �[90m│�[39m �[7m�[1mfork�[22m�[27m �[90m│�[39m 0 �[90m│�[39m �[32m�[1monline�[22m�[39m �[90m│�[39m 0% �[90m│�[39m 35.5mb �[90m│�[39m
�[90m└────┴────────────────────┴──────────┴──────┴───────────┴──────────┴──────────┘�[39m
监控服务启动成功...
======================5. 启动主服务========================
�[32m[PM2] �[39mStarting /ql/static/build/app.js in fork_mode (1 instance)
�[32m[PM2] �[39mDone.
�[90m┌────┬────────────────────┬──────────┬──────┬───────────┬──────────┬──────────┐�[39m
�[90m│�[39m�[1m�[36m id �[39m�[22m�[90m│�[39m�[1m�[36m name �[39m�[22m�[90m│�[39m�[1m�[36m mode �[39m�[22m�[90m│�[39m�[1m�[36m ↺ �[39m�[22m�[90m│�[39m�[1m�[36m status �[39m�[22m�[90m│�[39m�[1m�[36m cpu �[39m�[22m�[90m│�[39m�[1m�[36m memory �[39m�[22m�[90m│�[39m
�[90m├────┼────────────────────┼──────────┼──────┼───────────┼──────────┼──────────┤�[39m
�[90m│�[39m�[1m�[36m �[1m�[36m1�[39m�[36m�[22m�[1m �[39m�[22m�[90m│�[39m panel �[90m│�[39m �[7m�[1mfork�[22m�[27m �[90m│�[39m 0 �[90m│�[39m �[32m�[1monline�[22m�[39m �[90m│�[39m 0% �[90m│�[39m 3.3mb �[90m│�[39m
�[90m│�[39m�[1m�[36m �[1m�[36m0�[39m�[36m�[22m�[1m �[39m�[22m�[90m│�[39m public �[90m│�[39m �[7m�[1mfork�[22m�[27m �[90m│�[39m 0 �[90m│�[39m �[32m�[1monline�[22m�[39m �[90m│�[39m 200% �[90m│�[39m 74.2mb �[90m│�[39m
�[90m└────┴────────────────────┴──────────┴──────┴───────────┴──────────┴──────────┘�[39m
主服务启动成功...
======================6. 启动定时任务========================
�[32m[PM2] �[39mStarting /ql/static/build/schedule.js in fork_mode (1 instance)
�[32m[PM2] �[39mDone.
�[90m┌────┬────────────────────┬──────────┬──────┬───────────┬──────────┬──────────┐�[39m
�[90m│�[39m�[1m�[36m id �[39m�[22m�[90m│�[39m�[1m�[36m name �[39m�[22m�[90m│�[39m�[1m�[36m mode �[39m�[22m�[90m│�[39m�[1m�[36m ↺ �[39m�[22m�[90m│�[39m�[1m�[36m status �[39m�[22m�[90m│�[39m�[1m�[36m cpu �[39m�[22m�[90m│�[39m�[1m�[36m memory �[39m�[22m�[90m│�[39m
�[90m├────┼────────────────────┼──────────┼──────┼───────────┼──────────┼──────────┤�[39m
�[90m│�[39m�[1m�[36m �[1m�[36m1�[39m�[36m�[22m�[1m �[39m�[22m�[90m│�[39m panel �[90m│�[39m �[7m�[1mfork�[22m�[27m �[90m│�[39m 0 �[90m│�[39m �[32m�[1monline�[22m�[39m �[90m│�[39m 150% �[90m│�[39m 78.5mb �[90m│�[39m
�[90m│�[39m�[1m�[36m �[1m�[36m0�[39m�[36m�[22m�[1m �[39m�[22m�[90m│�[39m public �[90m│�[39m �[7m�[1mfork�[22m�[27m �[90m│�[39m 0 �[90m│�[39m �[32m�[1monline�[22m�[39m �[90m│�[39m 0% �[90m│�[39m 88.0mb �[90m│�[39m
�[90m│�[39m�[1m�[36m �[1m�[36m2�[39m�[36m�[22m�[1m �[39m�[22m�[90m│�[39m schedule �[90m│�[39m �[7m�[1mfork�[22m�[27m �[90m│�[39m 0 �[90m│�[39m �[32m�[1monline�[22m�[39m �[90m│�[39m 0% �[90m│�[39m 15.9mb �[90m│�[39m
�[90m└────┴────────────────────┴──────────┴──────┴───────────┴──────────┴──────────┘�[39m
定时任务启动成功...
======================8. 执行自定义脚本========================
自定义脚本后台执行中...
############################################################
容器启动成功...
请先访问5700端口,登录成功面板之后再执行添加定时任务...
############################################################
./docker/docker-entrypoint.sh: line 59: crond: command not found
`
这是Dockerfile
`FROM python:3.10-slim as builder
COPY package.json .npmrc pnpm-lock.yaml /tmp/build/
RUN apt update && apt upgrade -y && apt install curl -y
#RUN set -x && sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \ && sed -i 's|security.debian.org/debian-security|mirrors.ustc.edu.cn/debian-security|g' /etc/apt/sources.list
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
RUN apt install -y nodejs
RUN set -x
&& apt-get update
&& apt-get install -y --no-install-recommends git
&& npm i -g pnpm
&& cd /tmp/build
&& pnpm install --prod
FROM python:3.10-slim
ARG QL_MAINTAINER="whyour"
LABEL maintainer="${QL_MAINTAINER}"
ARG QL_URL=https://kgithub.qkg1.top/${QL_MAINTAINER}/qinglong.git
ARG QL_BRANCH=develop
ENV PNPM_HOME=/root/.local/share/pnpm
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.local/share/pnpm:/root/.local/share/pnpm/global/5/node_modules:$PNPM_HOME
NODE_PATH=/usr/local/bin:/usr/local/pnpm-global/5/node_modules:/usr/local/lib/node_modules:/root/.local/share/pnpm/global/5/node_modules
LANG=zh_CN.UTF-8
SHELL=/bin/bash
PS1="\u@\h:\w $ "
QL_DIR=/ql
QL_BRANCH=${QL_BRANCH}
RUN set -x && sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
&& sed -i 's|security.debian.org/debian-security|mirrors.ustc.edu.cn/debian-security|g' /etc/apt/sources.list
&& apt-get update
&& apt-get upgrade -y
&& apt-get --no-install-recommends -y install bash
coreutils
moreutils
git
curl
wget
tzdata
perl
openssl
nginx
jq
openssh-client
curl
&& curl -fsSL https://deb.nodesource.com/setup_16.x | bash - &&
apt-get install -y nodejs
&& rm -rf /var/cache/apt/*
&& apt-get update
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
&& echo "Asia/Shanghai" > /etc/timezone
&& git config --global user.email "qinglong@@users.noreply.github.com"
&& git config --global user.name "qinglong"
&& git config --global http.postBuffer 524288000
&& npm install -g pnpm
&& pnpm add -g pm2 ts-node typescript tslib
&& rm -rf /root/.pnpm-store
&& rm -rf /root/.local/share/pnpm/store
&& rm -rf /root/.cache
&& rm -rf /root/.npm
ARG SOURCE_COMMIT
RUN git clone -b ${QL_BRANCH} ${QL_URL} ${QL_DIR}
&& cd ${QL_DIR}
&& cp -f .env.example .env
&& chmod 777 ${QL_DIR}/shell/.sh
&& chmod 777 ${QL_DIR}/docker/.sh
&& git clone -b ${QL_BRANCH} https://kgithub.qkg1.top/${QL_MAINTAINER}/qinglong-static.git /static
&& mkdir -p ${QL_DIR}/static
&& cp -rf /static/* ${QL_DIR}/static
&& rm -rf /static
COPY --from=builder /tmp/build/node_modules/. /ql/node_modules/
WORKDIR ${QL_DIR}
ENTRYPOINT ["./docker/docker-entrypoint.sh"]
`
All reactions