Docker: standard_init_linux.go:228: exec 用户进程导致: 没有这样的文件或目录
我得到了这个 docker 文件:
version: "3.7"
x-web-environment: &web-environment
environment:
- PORT=8000
- ENVIRONMENT_NAME=local_dev
- USING_DOCKER_COMPOSE=true
- DJANGO_SETTINGS_MODULE=backend.settings.dev
- DJANGO_CONFIGURATION=Local
- DJANGO_ALLOWED_HOSTS=web,localhost
- DJANGO_CORS_ORIGIN_WHITELIST
- DJANGO_ADMIN_URL=***
- POSTGRES_USER=documentcrawler
- POSTGRES_PASSWORD=*****
- POSTGRES_HOST=postgres
- POSTGRES_DB=****
- DJANGO_SECRET_KEY=*******************
- REDIS_SERVER_IP=redis
build:
context: ./
dockerfile: Dockerfile.api
volumes:
- type: bind
source: ./
target: /code
- type: bind
source: /tmp
target: /tmp
services:
postgres:
restart: always
image: postgres:14
environment:
- POSTGRES_USER=****
- POSTGRES_PASSWORD=****
- POSTGRES_HOST=*****
- POSTGRES_DB=****
- PGDATA=/data/pgdata
volumes:
- ./pgdata:/data/pgdata
ports:
- "5433:5432"
redis:
restart: always
image: redis:latest
ports:
- "6379:6379"
rabbitmq:
restart: always
image: rabbitmq:3.9
environment:
- RABBITMQ_DEFAULT_USER=****
- RABBITMQ_DEFAULT_PASS=****
ports:
- "5432:5432"
api:
<<: *web-environment
restart: always
ports:
- "8000:8000"
command: "scripts/local/run_web.sh"
app:
restart: always
ports:
- "3000:3000"
environment:
- API_URL=http://api:8000
- INTERNAL_API_URL=http://api:8000
build:
context: ./
dockerfile: Dockerfile.app
ctaima:
<<: *web-environment
restart: always
build:
context: .
dockerfile: Dockerfile
command: ["dramatiq", "-p", "1", "-t", "1", "crawler.tasks.broker:rabbitmq_broker", "--queues", "ctaima"]
shm_size: "4gb"
redis:
image: redis:alpine
ports:
- "6379:6379"
我的 Dockerfile.api:
FROM python:3.8
ENV PYTHONUNBUFFERED 1
# Add system dependencies
RUN apt update && apt install postgresql gcc python3-dev musl-dev libffi-dev make python3-watchdog -y
# Allows docker to cache installed dependencies between builds
COPY Pipfile* ./
RUN pip install pipenv
RUN pipenv install --dev --system --deploy --ignore-pipfile
# Adds our application code to the image
COPY . /code/
WORKDIR /code
# Expose Django's port
EXPOSE $PORT
#CMD "scripts/local/run_web.sh"
CMD "scripts/local/run_web.sh"
我的树:
scripts/local/run_web.sh
scripts/local/wait_for_postgres.py
scripts/prod/run_web.sh
除了生成错误“standard_init_linux.go:228:执行用户进程导致:没有这样的文件或目录”的 API 容器之外,所有容器都工作正常,
我该如何解决这个问题?非常感谢你!
这是一个继承的项目,不是我的,我不知道如何解决它,我希望你能帮我一把。
I got this docker file:
version: "3.7"
x-web-environment: &web-environment
environment:
- PORT=8000
- ENVIRONMENT_NAME=local_dev
- USING_DOCKER_COMPOSE=true
- DJANGO_SETTINGS_MODULE=backend.settings.dev
- DJANGO_CONFIGURATION=Local
- DJANGO_ALLOWED_HOSTS=web,localhost
- DJANGO_CORS_ORIGIN_WHITELIST
- DJANGO_ADMIN_URL=***
- POSTGRES_USER=documentcrawler
- POSTGRES_PASSWORD=*****
- POSTGRES_HOST=postgres
- POSTGRES_DB=****
- DJANGO_SECRET_KEY=*******************
- REDIS_SERVER_IP=redis
build:
context: ./
dockerfile: Dockerfile.api
volumes:
- type: bind
source: ./
target: /code
- type: bind
source: /tmp
target: /tmp
services:
postgres:
restart: always
image: postgres:14
environment:
- POSTGRES_USER=****
- POSTGRES_PASSWORD=****
- POSTGRES_HOST=*****
- POSTGRES_DB=****
- PGDATA=/data/pgdata
volumes:
- ./pgdata:/data/pgdata
ports:
- "5433:5432"
redis:
restart: always
image: redis:latest
ports:
- "6379:6379"
rabbitmq:
restart: always
image: rabbitmq:3.9
environment:
- RABBITMQ_DEFAULT_USER=****
- RABBITMQ_DEFAULT_PASS=****
ports:
- "5432:5432"
api:
<<: *web-environment
restart: always
ports:
- "8000:8000"
command: "scripts/local/run_web.sh"
app:
restart: always
ports:
- "3000:3000"
environment:
- API_URL=http://api:8000
- INTERNAL_API_URL=http://api:8000
build:
context: ./
dockerfile: Dockerfile.app
ctaima:
<<: *web-environment
restart: always
build:
context: .
dockerfile: Dockerfile
command: ["dramatiq", "-p", "1", "-t", "1", "crawler.tasks.broker:rabbitmq_broker", "--queues", "ctaima"]
shm_size: "4gb"
redis:
image: redis:alpine
ports:
- "6379:6379"
My Dockerfile.api:
FROM python:3.8
ENV PYTHONUNBUFFERED 1
# Add system dependencies
RUN apt update && apt install postgresql gcc python3-dev musl-dev libffi-dev make python3-watchdog -y
# Allows docker to cache installed dependencies between builds
COPY Pipfile* ./
RUN pip install pipenv
RUN pipenv install --dev --system --deploy --ignore-pipfile
# Adds our application code to the image
COPY . /code/
WORKDIR /code
# Expose Django's port
EXPOSE $PORT
#CMD "scripts/local/run_web.sh"
CMD "scripts/local/run_web.sh"
My tree:
scripts/local/run_web.sh
scripts/local/wait_for_postgres.py
scripts/prod/run_web.sh
All containers work perfectly except the API container that generates the error "standard_init_linux.go:228: exec user process caused: no such file or directory"
How can i fix that? thanks u so much!
It is an inherited project that is not mine and I don't know how I can solve it, I hope you can give me a hand.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论