当我在windows 10上运行docker映像时。我得到这个错误:
standard_init_linux.go:190: exec user process caused "no such file or directory"
我的docker文件是:
FROM openjdk:8
EXPOSE 8080
VOLUME /tmp
ADD appagent.tar.gz /opt/app-agent
ADD services.jar app.jar
ADD run.sh /run.sh
# Install compiler and perl stuff
RUN apt-get update
RUN apt-get install -y build-essential
RUN apt-get install -y gcc-multilib
RUN apt-get install -y perl
# Install Percona Toolkit
RUN apt-get install --yes percona-toolkit
RUN ["chmod", "+x", "/run.sh"]
ENTRYPOINT ["/run.sh"]
脚本以# !/bin/sh开头
#!/bin/sh
set -e
JAVA_OPTS="-Dfile.encoding=UTF-8 -Djava.security.egd=file:/dev/urandom"
if [ "${APPD_APP_NAME}" != "" ]; then
JAVA_AGENT="-javaagent:/opt/app-agent/javaagent.jar
fi
exec java ${JVM_OPTS} ${JAVA_OPTS} ${JAVA_AGENT} -jar /app.jar
< p >尝试method1:
试着改变#!/bin/sh到#!/bin/bash但是得到相同的错误。
< p >尝试method2:
增加docker文件中的dos2unix
RUN apt-get install -y dos2unix
RUN dos2unix /run.sh