[英]Docker – "flower": executable file not found in $PATH: unknown
I'm trying to build a Docker file.我正在尝试构建一个 Docker 文件。 It goes all well up until the end, when I get the error message:一切顺利,直到最后,当我收到错误消息时:
ERROR: for flower Cannot start service flower: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "flower": executable file not found in $PATH: unknown错误:for flower 无法启动服务 flower:OCI 运行时创建失败:container_linux.go:380:启动容器进程导致:exec:“flower”:$PATH 中找不到可执行文件:未知
The corresponding compose.yml:对应的compose.yml:
version: "3.9"
services:
app: &app
image: registry.gitlab.inria.fr/scripta/escriptorium/app
build:
context: .
env_file: variables.env
volumes:
# - ./app/:/usr/src/app/
- static:/usr/src/app/static
- media:/usr/src/app/media
command: /bin/true
web:
<<: *app
command: uwsgi --ini /usr/src/app/uwsgi.ini
expose:
- 8000
channelserver:
<<: *app
command: daphne --bind 0.0.0.0 --port 5000 -v 1 escriptorium.asgi:application
expose:
- 5000
db:
image: postgres:10.5-alpine
volumes:
- postgres:/var/lib/postgresql/data/
env_file: variables.env
redis:
image: sickp/alpine-redis:4.0.6
nginx:
image: registry.gitlab.inria.fr/scripta/escriptorium/nginx
build: ./nginx
environment:
- SERVERNAME=${DOMAIN:-localhost}
volumes:
- type: bind
source: $PWD/nginx/nginx.conf
target: /etc/nginx/conf.d/nginx.conf
- static:/usr/src/app/static
- media:/usr/src/app/media
ports:
- 8080:80
celery-main:
<<: *app
environment:
- OMP_NUM_THREADS=1
command: "celery worker -l INFO -E -A escriptorium -Ofair --prefetch-multiplier 1 -Q default -c ${CELERY_MAIN_CONC:-10} --max-tasks-per-child=10"
celery-live:
<<: *app
command: "celery worker -l INFO -E -A escriptorium -Ofair --prefetch-multiplier 1 -Q live -c ${CELERY_LIVE_CONC:-10} --max-tasks-per-child=10"
celery-low-priority:
<<: *app
command: "celery worker -l INFO -E -A escriptorium -Ofair --prefetch-multiplier 1 -Q low-priority -c ${CELERY_LOW_CONC:-10} --max-tasks-per-child=10"
celery-gpu: &celery-gpu
<<: *app
environment:
- KRAKEN_TRAINING_DEVICE=cpu
command: "celery worker -l INFO -E -A escriptorium -Ofair --prefetch-multiplier 1 -Q gpu -c 1 --max-tasks-per-child=1"
shm_size: '3gb'
flower:
image: mher/flower
command: ["flower", "--broker=redis://redis:6379/0", "--port=5555"]
ports:
- 5555:5555
mail:
build: ./exim
image: registry.gitlab.inria.fr/scripta/escriptorium/mail
expose:
- 25
environment:
- PRIMARY_HOST=${DOMAIN:-localhost}
- ALLOWED_HOSTS=web ; celery-main ; celery-low-priority; docker0
volumes:
static:
media:
postgres:
esdata:
The following link is a great article on this: https://www.distributedpython.com/2018/10/13/flower-docker/以下链接是一篇很棒的文章: https://www.distributedpython.com/2018/10/13/flower-docker/
Essentially, replace "command" with the following:本质上,将“命令”替换为以下内容:
environment:
- CELERY_BROKER_URL=redis://redis:6379/0
- FLOWER_PORT=5555
You need to run celery flower--broker=redis://redis:6379/0 --port=5555
你需要运行celery flower--broker=redis://redis:6379/0 --port=5555
Following is from flower
official docs以下来自flower
官方文档
From version 1.0.1 Flower uses Celery 5 and has to be invoked in the same style as celery commands do.从 1.0.1 版起,Flower 使用 Celery 5,并且必须以与 celery 命令相同的方式调用。
You can also put celery specific arguments follow this template.您还可以在此模板之后放置 celery 特定参数。
celery [celery args] flower [flower args]芹菜 [芹菜 args] 花 [花 args]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.