none
standard_init_linux.go:207: exec user process caused "exec format error" RRS feed

  • Question

  • Hi, 

    I am currently trying to deploy my docker application to the container registry Azure. I am able to run my docker image locally but when I deploy it to azure, it gives me this error:

    standard_init_linux.go:207: exec user process caused "exec format error"

     Here is my 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
    # Uncomment to 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 

    Because I do not understand how azure calls my Docker images, I kept on trying different CMD versions such as:

    CMD ["python3""wsgi.py""runserver""0.0.0.0:8400"]

    But to no avail. I looked up on internet for solutions but really could not find any. Is there anyone there that has insights on what I do wrong? Is it essential to create a .sh file ? I am new to linux so any insights will help!

    Thanks again!

    Thursday, November 21, 2019 10:25 PM

All replies

  • Hi Albert,

    It looks like your issue is resolved, as per your stack overflow post here.
    You mentioned that 'The issue was because of the lack of shebang in my py file'.

    Please let us know if it is resolved. Thanks :)


    Friday, November 22, 2019 7:50 PM
    Moderator
  • Hello,

    Any update on the issue?

    If the suggested response helped you resolve your issue, do click on "Mark as Answer" and "Up-Vote" for the answer that helped you for benefit of the community.

    Thanks.
    Tuesday, November 26, 2019 10:57 AM
    Moderator
  • Hello,

    Any update on the issue?

    If the suggested response helped you resolve your issue, do click on "Mark as Answer" and "Up-Vote" for the answer that helped you for benefit of the community.

    Thanks.
    Friday, November 29, 2019 9:52 AM
    Moderator