我正在尝试使用以下 docker 文件在多阶段设置中创建 docker 映像
# the first stage of our build will extract the layers
FROM myorg.repository.com:8081/fsorg/base-java-service:java16 as builder
WORKDIR application
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} application.jar
RUN java -Djarmode=layertools -jar application.jar extract
# the second stage of our build will copy the extracted layers
FROM myorg.repository.com:8081/fsorg/base-java-service:java16
WORKDIR application
COPY --from=builder application/dependencies/ ./
COPY --from=builder application/spring-boot-loader/ ./
COPY --from=builder application/snapshot-dependencies/ ./
COPY --from=builder application/application/ ./
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"]
ERROR [stage-1 3/6] COPY --from=builder application/dependencies/ ./ 0.0s
ERROR [stage-1 4/6] COPY --from=builder application/spring-boot-loader/ ./ 0.0s
ERROR [stage-1 5/6] COPY --from=builder application/snapshot-dependencies/ ./ 0.0s
ERROR [stage-1 6/6] COPY --from=builder application/application/ ./ 0.0s
------
> [stage-1 3/6] COPY --from=builder application/dependencies/ ./:
------
------
> [stage-1 4/6] COPY --from=builder application/spring-boot-loader/ ./:
------
------
> [stage-1 5/6] COPY --from=builder application/snapshot-dependencies/ ./:
------
------
> [stage-1 6/6] COPY --from=builder application/application/ ./:
------
failed to compute cache key: failed to walk /var/lib/docker/overlay2/0c117e93018b8947ef49d2f3ceb73a05b9166f1e9c2291e31a649ccab5f3dcaa/merged/application: lstat /var/lib/docker/overlay2/0c117e93018b8947ef49d2f3ceb73a05b9166f1e9c2291e31a649ccab5f3dcaa/merged/application: no such file or directory
如果我用公共镜像替换 Java 基础镜像,它工作正常
FROM adoptopenjdk/openjdk16:ubi
有什么建议为什么我会收到上述错误?
使用 spring boot 版本 - 2.5.0