Alb*_*nto 2 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, 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
Run Code Online (Sandbox Code Playgroud)
因为我不明白 azure 如何调用我的 Docker 镜像,所以我不断尝试不同的 CMD 版本,例如:
CMD [“python3”,“wsgi.py”,“runserver”,“0.0.0.0:8400”]
但无济于事。我在互联网上查找解决方案,但确实找不到任何解决方案。有没有人对我做错了什么有见解?是否必须创建 .sh 文件?我是 Linux 新手,所以任何见解都会有所帮助!
再次感谢!
| 归档时间: |
|
| 查看次数: |
4345 次 |
| 最近记录: |