Python 标准“u init”linux.go:207:exec用户进程导致”;exec格式错误";
我当前正在尝试将docker应用程序部署到容器注册表Azure。我可以在本地运行我的docker映像,但当我将其部署到azure时,会出现以下错误: standard_init_linux.go:207:exec用户进程导致“exec格式错误” 这是我的dockerfile:Python 标准“u init”linux.go:207:exec用户进程导致”;exec格式错误";,python,linux,azure,docker,Python,Linux,Azure,Docker,我当前正在尝试将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, i
*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新手,所以任何见解都会有所帮助
再次感谢 我遇到过类似的问题,这是由于docker映像构建在一个体系结构(如AMD64)上,但在尝试在另一个体系结构(ARM64)上运行时失败了。 调查QEMU
你好,埃文,非常感谢您的回复!我已经看过azure架构,它是AMD64,我的docker也是AMD64。但我真的解决了我的问题!这是因为我的py文件中没有shebang。但是谢谢你给我时间回答:)我真的很感激这对我来说是正确的答案。我在一台ARM64机器上构建映像时遇到了这个错误。我用AMD64重新构建了它,并修复了它。