创建Docker映像时出现错误

时间:2020-08-22 13:10:17

标签: docker

我正在使用如下所示的docker文件

FROM openjdk:11-jre-slim as builder
WORKDIR application
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} application.jar
RUN java -Djarmode=layertools -jar application.jar extract
FROM openjdk:11-jre-slim
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"]

但是当我创建docker镜像时,我遇到了以下异常,请告知如何克服这个问题

Step 1/12 : FROM openjdk:11-jre-slim as builder
 ---> 2be0fcbbbb6e
Step 2/12 : WORKDIR application
 ---> Using cache
 ---> 3edb2b75a8b6
Step 3/12 : ARG JAR_FILE=target/*.jar
 ---> Using cache
 ---> 84d84fe6950d
Step 4/12 : ADD ${JAR_FILE} application.jar
Error response from daemon: When using ADD with more than one source file, the destination must be a directory and end with a /
Failed to deploy '<unknown> Dockerfile: Dockerfile': Can't retrieve image ID from build stream

0 个答案:

没有答案