• <small id='4yPVq'></small><noframes id='4yPVq'>

      1. <legend id='4yPVq'><style id='4yPVq'><dir id='4yPVq'><q id='4yPVq'></q></dir></style></legend>
        <i id='4yPVq'><tr id='4yPVq'><dt id='4yPVq'><q id='4yPVq'><span id='4yPVq'><b id='4yPVq'><form id='4yPVq'><ins id='4yPVq'></ins><ul id='4yPVq'></ul><sub id='4yPVq'></sub></form><legend id='4yPVq'></legend><bdo id='4yPVq'><pre id='4yPVq'><center id='4yPVq'></center></pre></bdo></b><th id='4yPVq'></th></span></q></dt></tr></i><div id='4yPVq'><tfoot id='4yPVq'></tfoot><dl id='4yPVq'><fieldset id='4yPVq'></fieldset></dl></div>

        <tfoot id='4yPVq'></tfoot>
          <bdo id='4yPVq'></bdo><ul id='4yPVq'></ul>
      2. standard_init_linux.go:211: exec 用户进程导致“exec 格式

        时间:2023-09-10
          <bdo id='3cEde'></bdo><ul id='3cEde'></ul>

                <tbody id='3cEde'></tbody>

                <small id='3cEde'></small><noframes id='3cEde'>

              1. <legend id='3cEde'><style id='3cEde'><dir id='3cEde'><q id='3cEde'></q></dir></style></legend><tfoot id='3cEde'></tfoot>
              2. <i id='3cEde'><tr id='3cEde'><dt id='3cEde'><q id='3cEde'><span id='3cEde'><b id='3cEde'><form id='3cEde'><ins id='3cEde'></ins><ul id='3cEde'></ul><sub id='3cEde'></sub></form><legend id='3cEde'></legend><bdo id='3cEde'><pre id='3cEde'><center id='3cEde'></center></pre></bdo></b><th id='3cEde'></th></span></q></dt></tr></i><div id='3cEde'><tfoot id='3cEde'></tfoot><dl id='3cEde'><fieldset id='3cEde'></fieldset></dl></div>

                  本文介绍了standard_init_linux.go:211: exec 用户进程导致“exec 格式错误"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在为 python 脚本构建 Dockerfile,它将在 minikube windows 10 系统中运行,下面是我的 Dockerfile

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

                  使用以下命令构建 dockerdocker build -t python-helloworld .

                  Building the docker using the below command docker build -t python-helloworld .

                  并将其加载到 minikube docker 恶魔中docker save python-helloworld |(eval $(minikube docker-env) && docker load)

                  and loading that in minikube docker demon docker save python-helloworld | (eval $(minikube docker-env) && docker load)

                  Docker 文件

                  FROM python:3.7-alpine
                  #add user group and ass user to that group
                  RUN addgroup -S appgroup && adduser -S appuser -G appgroup
                  
                  #creates work dir   
                  WORKDIR /app
                  
                  #copy python script to the container folder app
                  COPY helloworld.py /app/helloworld.py
                  
                  #user is appuser
                  USER appuser
                  
                  ENTRYPOINT  ["python", "/app/helloworld.py"]
                  

                  pythoncronjob.yml 文件(cron 作业文件)

                  pythoncronjob.yml file (cron job file)

                  apiVersion: batch/v1beta1
                  kind: CronJob
                  metadata:
                    name: python-helloworld
                  spec:
                    schedule: "*/1 * * * *"
                    jobTemplate:
                      spec:
                        backoffLimit: 5
                        template:
                          spec:
                            containers:
                            - name: python-helloworld
                              image: python-helloworld
                              imagePullPolicy: IfNotPresent
                              command: [/app/helloworld.py]
                            restartPolicy: OnFailure
                  

                  下面是运行这个 Kubernetes 作业的命令kubectl create -f pythoncronjob.yml

                  Below is the command to run this Kubernetes job kubectl create -f pythoncronjob.yml

                  但是得到以下错误作业并没有成功运行,但是当你单独运行 Dockerfile 时,它​​的工作正常

                  But getting the below error job is not running scuessfully but when u ran the Dockerfile alone its work fine

                  standard_init_linux.go:211: exec 用户进程导致exec 格式错误"

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

                  推荐答案

                  我看到你在yaml文件中添加了命令command: [/app/helloworld.py].

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

                  所以你需要(在 Dockerfile 中):

                  so you need to (in Dockerfile):

                  RUN chmod +x /app/helloworld.py
                  

                  将 shebang 设置为您的 py 文件:

                  set shebang to your py file:

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

                  或像在 Dockerfile

                  这篇关于standard_init_linux.go:211: exec 用户进程导致“exec 格式错误"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Docker如何仅在发生更改时运行pip requirements.txt? 下一篇:将 Python 诗歌与 Docker 集成

                  相关文章

                  最新文章

                    <legend id='CfKOI'><style id='CfKOI'><dir id='CfKOI'><q id='CfKOI'></q></dir></style></legend>
                    • <bdo id='CfKOI'></bdo><ul id='CfKOI'></ul>
                  1. <tfoot id='CfKOI'></tfoot>

                    <small id='CfKOI'></small><noframes id='CfKOI'>

                      <i id='CfKOI'><tr id='CfKOI'><dt id='CfKOI'><q id='CfKOI'><span id='CfKOI'><b id='CfKOI'><form id='CfKOI'><ins id='CfKOI'></ins><ul id='CfKOI'></ul><sub id='CfKOI'></sub></form><legend id='CfKOI'></legend><bdo id='CfKOI'><pre id='CfKOI'><center id='CfKOI'></center></pre></bdo></b><th id='CfKOI'></th></span></q></dt></tr></i><div id='CfKOI'><tfoot id='CfKOI'></tfoot><dl id='CfKOI'><fieldset id='CfKOI'></fieldset></dl></div>