standard_init_linux.go:219: exec user process caused: exec format error

Question:

I built and ran my dockerfile but am getting the error standard_init_linux.go:219: exec user process caused: exec format error. What does this mean and why is this happening per my configuration?

DOCKERFILE:

# 1
FROM python:3.9.2-slim

# 2
COPY requirements.txt /
RUN pip3 install -r /requirements.txt

# 3
COPY . /
WORKDIR /

# 4
RUN "./gunicorn.sh"

gunicorn.sh:

gunicorn "website:create_app()" -w 3 -p 5000

I am using docker build -t gunicorn-flask-example . in the directory of the dockerfile.

Asked By: Star

||

Answers:

I forgot to put #!/bin/sh on the top of ‘gunicorn.sh’. Adding this line fixed the problem.

Answered By: Star

Another way is change RUN "./gunicorn.sh" to RUN "sh ./gunicorn.sh"

Answered By: lyj