【发布时间】:2022-01-25 06:57:00
【问题描述】:
我有这个小版本:
FROM eclipse-temurin:17-jdk as build-java
COPY java-project /root/project
WORKDIR /root/project
RUN chmod +x ./gradlew
RUN ls
RUN ./gradlew ...
#9 [build-build-java 5/6] RUN ls
#9 sha256:2d05b1e31ea4eaa8a9343b4f48fadcf7351b9d55dcc9c27e572d7bb32c4d723c
#9 0.194 build
#9 0.194 build.gradle
#9 0.194 docker-compose.yml
#9 0.194 gradle
#9 0.194 gradlew
#9 0.194 gradlew.bat
#9 0.194 HELP.md
#9 0.194 lombok.config
#9 0.194 settings.gradle
#9 0.194 src
#9 DONE 0.2s
#10 [build-build-java 6/6] RUN ./gradlew ...
#10 sha256:62cb4a1a6288008f3faccc3504e63ef87d30c3d7fde904a0576ffcf571e9b310
#10 0.310 /bin/sh: 1: ./gradlew: not found
#10 ERROR: executor failed running [/bin/sh -c ./gradlew ...]: exit code: 127
我已经被困了一段时间了。
我尝试使用FROM gradle,然后使用gradle ...,但随后出现此文件安装错误:
#10 sha256:26de7798a76971c3eb12e6398f830ee487fe41c110d0f8ca6a23a92ee5437267
#10 0.854
#10 0.854 Welcome to Gradle 7.3.3!
#10 0.854
#10 0.854 Here are the highlights of this release:
#10 0.854 - Easily declare new test suites in Java projects
#10 0.855 - Support for Java 17
#10 0.855 - Support for Scala 3
#10 0.855
#10 0.855 For more details see https://docs.gradle.org/7.3.3/release-notes.html
#10 0.855
#10 0.952 Starting a Gradle Daemon (subsequent builds will be faster)
#10 2.153 Unable to list file systems to check whether they can be watched. Assuming all file systems can be watched. Re
ason: Could not query file systems: could not open mount file (errno 2: No such file or directory)
【问题讨论】:
-
您是偶然从 Windows 构建映像的吗?
-
@thokuest 我是。我想知道这是否是 WSL 的一些错误?
-
Gradle 包装器
gradlew是一个 shell 脚本,如果 shell 脚本以 DOS 行结尾被复制,您可能会收到类似这样的“未找到”错误。 -
你的问题解决了吗?
-
我看到有人发表了这个评论,我在 intellij 中将行尾从“CLRF”切换为“LF”,但它没有修复它@DavidMaze