我正在关注here中的Spring Boot Docker教程。
我在连接互联网时得到了确切的结果。现在,我需要在没有Internet连接的环境中产生相同的结果。我将Maven存储库和Docker映像复制到了新环境中。我非常确定maven和docker已启动并正在运行。
当我尝试运行以下命令com.google.cloud.tools:jib-maven-plugin:dockerBuild -Dimage=eureka
时,出现错误消息。我猜有一些文件插件找不到,但不确定哪个文件。
我要添加错误消息
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------------< com.ays:eureka >---------------------------
[INFO] Building eureka 0.0.1-snAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- jib-maven-plugin:2.1.0:dockerBuild (default-cli) @ eureka ---
[INFO]
[INFO] Containerizing application to Docker daemon as eureka...
[WARNING] Base image 'gcr.io/distroless/java:8' does not use a specific image digest - build may not be reproducible
[ERROR] I/O error for image [gcr.io/distroless/java]:
[ERROR] org.apache.http.conn.ConnectTimeoutException
[ERROR] Connect to gcr.io:443 [gcr.io/64.233.184.82] failed: connect timed out
[INFO] Executing tasks:
[INFO] [============ ] 40,0% complete
[INFO] > building image to Docker daemon
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.409 s
[INFO] Finished at: 2020-04-13T16:37:23+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:2.1.0:dockerBuild (default-cli) on project eureka: Connect to gcr.io:443 [gcr.io/64.233.184.82] failed: connect timed out -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors,re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions,please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
有人可以指出我应该去哪里,或者我现在缺少什么?
这是我的DockerFile
FROM openjdk:8-jdk-alpine
RUN addgroup -S spring && adduser -S spring -G spring
USER spring:spring
ARG DEPENDENCY=target/dependency
COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY ${DEPENDENCY}/Meta-INF /app/Meta-INF
COPY ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT ["java","-cp","app:app/lib/*","hello.Application"]`
我没有更改DockerFile中的任何内容。