gpt4 book ai didi

python - 标准_init_linux.go :207: exec user process caused "exec format error"

转载 作者:太空宇宙 更新时间:2023-11-03 20:05:25 26 4
gpt4 key购买 nike

我目前正在尝试将我的 Docker 应用程序部署到容器注册表 Azure。我可以在本地运行我的 docker 镜像,但是当我将其部署到 azure 时,它​​给了我这个错误:

standard_init_linux.go:207: exec 用户进程导致“exec 格式错误” 这是我的 dockerfile:

*Pull a pre-built alpine docker image with nginx and python3 installed

*this image is from docker community, its small so our upload to contain will be faster

FROM tiangolo/uwsgi-nginx-flask:python3.7

FROM ubuntu:latest

ENV LISTEN_PORT=8400

EXPOSE 8400

RUN apt-get update && apt-get install -y /

curl apt-utils apt-transport-https debconf-utils gcc build-essential g++-5\

&& rm -rf /var/lib/apt/lists/*

*adding custom MS repository

RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -

RUN curl https://packages.microsoft.com/config/ubuntu/19.04/prod.list > /etc/apt/sources.list.d/mssql-release.list

RUN apt-get update && ACCEPT_EULA=Y apt-get install -y msodbcsql17

*install SQL Server drivers

RUN apt-get update && ACCEPT_EULA=Y apt-get -f install -y unixodbc-dev

*install SQL Server tools

RUN apt-get update && ACCEPT_EULA=Y apt-get install -y mssql-tools

RUN echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc

RUN /bin/bash -c "source ~/.bashrc"

RUN apt-get update && apt-get install -y python3-pip

RUN apt-get update && apt-get install -y libpq-dev

*install additional requirements from a requirements.txt file

COPY requirements.txt /

RUN pip3 install --no-cache-dir -r /requirements.txt

COPY app/. /.

CMD python3 wsgi.py

因为我不明白 azure 如何调用我的 Docker 镜像,所以我不断尝试不同的 CMD 版本,例如:

CMD [“python3”,“wsgi.py”,“runserver”,“0.0.0.0:8400”]

但是没有效果。我在互联网上查找解决方案,但确实找不到任何解决方案。有没有人对我做错了什么有见解?是否必须创建 .sh 文件?我是 Linux 新手,所以任何见解都会有帮助!

再次感谢!

最佳答案

我遇到过类似的问题,这些问题是由于在一种架构(例如 AMD64)上构建 docker 镜像而导致的,但在尝试在不同架构(ARM64)上运行时失败。看看QEMU tutorial

docker ref

关于python - 标准_init_linux.go :207: exec user process caused "exec format error",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59000007/

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