gpt4 book ai didi

python - 始终无法通过重新启动 '' 重新启动 docker 容器''

转载 作者:行者123 更新时间:2023-12-04 18:44:02 25 4
gpt4 key购买 nike

我已经尝试了所有方法,但无法重新启动我的 docker 容器。如果使用 --restart "always"它会进入无限循环的重启。

以下是 Dockerfile 的配置:-

FROM continuumio/anaconda3:4.4.0
EXPOSE 8000
RUN echo "deb http://deb.debian.org/debian jessie main" > /etc/apt/sources.list
RUN apt-get update && apt-get install -y apache2 \
apache2-dev \
vim \
&& apt-get clean \
&& apt-get autoremove \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /var/www/test/
COPY ./test.wsgi /var/www/test/test.wsgi
COPY ./Demo /var/www/test/
RUN /opt/conda/bin/mod_wsgi-express install-module
RUN mod_wsgi-express setup-server test.wsgi --port=8000 \
--user www-data --group www-data \
--server-root=/etc/mod_wsgi-express-80
CMD /etc/mod_wsgi-express-80/apachectl start -D FOREGROUND


并使用以下命令运行容器:-
docker run -d -p 8000:8000 --restart always test1

重新启动 docker/server 后
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                          PORTS                  NAMES
f4ec5dc90809 test1 "/usr/bin/tini -- /b…" 2 minutes ago Restarting (0) 26 seconds ago practical_colden

我也尝试过失败,但效果不佳。

容器日志
/etc/mod_wsgi-express-80/apachectl: line 63: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory
httpd (pid 7) already running
/etc/mod_wsgi-express-80/apachectl: line 63: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory
httpd (pid 7) already running
/etc/mod_wsgi-express-80/apachectl: line 63: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory
httpd (pid 7) already running

最佳答案

首先想到的是正在运行的(不幸的是不完整的)命令 "/usr/bin/tini -- /b…"查看源图像 Dockerfile https://hub.docker.com/r/continuumio/anaconda3/dockerfile那是定义的入口点。您可以更改上一个 CMDENTRYPOINT的测试用 docker run --entrypoint $your-command -p ... 启动 docker 容器看看它是否有效

关于python - 始终无法通过重新启动 '' 重新启动 docker 容器'',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62196782/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com