我正在尝试使用JKube构建 API 并将其部署到我的 K8S 集群,但是当我这样做时,mvn k8s:build
我收到了这个错误:
[INFO] --- kubernetes-maven-plugin:1.1.1:build (default-cli) @ trips-api ---
[INFO] k8s: Running in Kubernetes mode
[INFO] k8s: Building Docker image in Kubernetes mode
[INFO] k8s: [carpooling/trips-api:latest]: Created docker-build.tar in 2 seconds
[ERROR] k8s: Failed to execute the build [Error while trying to build the image: Unable to build image [carpooling/trips-api:latest] : "COPY failed: no source files were specified" ]
这是我的内容Dockerfile
:
FROM adoptopenjdk/openjdk11:latest
VOLUME /tmp
COPY target/*.jar app.jar
ENTRYPOINT ["java","-jar","/app.jar"]
注意:我确保在我的 target/ 目录下我有正确的 jar 文件。
有谁知道我为什么会收到这个错误?