我对 docker 还很陌生,我完全不知道如何解决我的问题。我已经搜索和搜索,到目前为止,我发现没有任何东西可以解决我的问题。
无论我做什么,我似乎都无法找到并执行我的 bash 脚本。
仅供参考 - 我正在使用 dockerfile-maven-plugin 启动 docker 构建过程
这是我的码头文件:
FROM openjdk:8-jre
WORKDIR / ## I've also tried other directories, besides root
ARG JAR_FILE ## variable inject via dockerfile-maven-plugin
ADD ${JAR_FILE} /motus-exec.jar
ADD run_motus.sh /
RUN ["chmod", "+x", "/run_motus.sh"]
ENTRYPOINT ["/run_motus.sh"]
这是我的脚本
#!/bin/sh
/usr/bin/java -jar /motus-exec.jar
构建 docker 映像的输出
[INFO] Step 1 : FROM openjdk:8-jre
[INFO] Trying to pull repository docker.io/library/openjdk ...
[INFO] Pulling from docker.io/library/openjdk
[INFO] Digest: sha256:2216ccda45993afaa42b3b269aa1ae8832cb2fabbf8207f63d528fdc7c8a087b
[INFO] Status: Image is up to date for docker.io/openjdk:8-jre
[INFO] ---> ed287c436e66
[INFO] Step 2 : WORKDIR /
[INFO] ---> Running in 779de913ad3b
[INFO] ---> 7ba637ea0ee8
[INFO] Removing intermediate container 779de913ad3b
[INFO] Step 3 : ARG JAR_FILE
[INFO] ---> Running in 99c86f5273f0
[INFO] ---> 8b0e9f39c1ab
[INFO] Removing intermediate container 99c86f5273f0
[INFO] Step 4 : ADD ${JAR_FILE} /motus-exec.jar
[INFO] ---> 4bd2c163c7c3
[INFO] Removing intermediate container 9a9098d6e51a
[INFO] Step 5 : ADD run_motus.sh /
[INFO] ---> 115cc9b09439
[INFO] Removing intermediate container 51e610f15427
[INFO] Step 6 : RUN chmod +x /run_motus.sh
[INFO] ---> Running in 62dabd8b432e
[INFO] ---> 8db646df2936
[INFO] Removing intermediate container 62dabd8b432e
[INFO] Step 7 : ENTRYPOINT /run_motus.sh
[INFO] ---> Running in 330c5442d61a
[INFO] ---> 0d9c0f6f5a34
[INFO] Removing intermediate container 330c5442d61a
[INFO] Successfully built 0d9c0f6f5a34
运行图像时输出
>> docker run tl/motus-sol:0.2.2-SNAPSHOT
no such file or directory
docker: Error response from daemon: Container command not found or does not exist..
提前感谢您的任何帮助。