standard_init_linux.go:211: exec user process caused “exec format error”

前端 未结 4 1044
孤独总比滥情好
孤独总比滥情好 2020-12-29 18:58

I am building the Dockerfile for python script which will run in minikube windows 10 system below is my Dockerfile

Building the docker using the below command

相关标签:
4条回答
  • 2020-12-29 19:35

    I recently encountered the problem when running a logstash container

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

    Noticed that the shebang line (#!/bin/sh) on the entrypoint.sh was typed in the second line instead of the first line of the entrypoint.sh file.

    When the shebang line is made as to the first line in the script, the error went away and "docker run -it logstashimage:latest sh" worked perfectly.

    0 讨论(0)
  • 2020-12-29 19:40

    I can see that you add the command command: [/app/helloworld.py] to yaml file.

    so you need to (in Dockerfile):

    RUN chmod +x /app/helloworld.py
    

    set shebang to your py file:

    #!/usr/bin/env python # whatever your defualt python to run the script
    

    or setup the command the same as you did in Dockerfile

    0 讨论(0)
  • 2020-12-29 19:49

    Another two reasons could raise this issue if you run docker on Windows:

    • scripts line endings are not LF (linux)
    • scripts encoding should be utf-8 + BOM
    0 讨论(0)
  • 2020-12-29 19:54

    This can also happen when your host machine has a different architecture from your guest container image.

    E.g. running an arm container on a host with x86-64 architecture

    0 讨论(0)
提交回复
热议问题