docker开始抛出此错误:
standard_init_linux.go:178:exec用户进程导致"exec格式错误"
每当我使用CMD或ENTRYPOINT运行特定的docker容器时,不考虑对文件的任何更改,然后删除CMD或ENTRYPOINT.这是我一直在使用的docker文件,它在大约一小时前完美运行:
FROM buildpack-deps:jessie
ENV PATH /usr/local/bin:$PATH
ENV LANG C.UTF-8
RUN apt-get update && apt-get install -y --no-install-recommends \
tcl \
tk \
&& rm -rf /var/lib/apt/lists/*
ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
ENV PYTHON_VERSION 3.6.0
ENV PYTHON_PIP_VERSION 9.0.1
RUN set -ex \
&& buildDeps=' \
tcl-dev \
tk-dev \
' \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
\
&& wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
&& wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
&& export GNUPGHOME="$(mktemp …Run Code Online (Sandbox Code Playgroud) 我有简单的perl脚本如下:
#!/usr/bin/perl
use strict;
use warnings;
print "hello world!\n";
Run Code Online (Sandbox Code Playgroud)
我可以执行如下脚本:
>temp.pl
hello world!
>
Run Code Online (Sandbox Code Playgroud)
如果我添加这样的评论:
#this script is just for test
#the shebang
#!/usr/bin/perl
use strict;
use warnings;
print "hello world!\n";
Run Code Online (Sandbox Code Playgroud)
当我尝试执行时,它给我输出如下:
> temp.pl
use: Command not found.
use: Command not found.
print: Command not found.
>
Run Code Online (Sandbox Code Playgroud)
这里的重点是shebang line应该总是在顶部无论如何.但有人能解释我为什么吗?
我目前正在尝试将我的 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 …Run Code Online (Sandbox Code Playgroud)