MVN 构建镜像 - “拨号 tcp:查找 github.com:名称解析暂时失败”

Ald*_*lva 4 maven spring-boot-maven-plugin docker-image

我正在尝试使用命令构建 docker 映像mvn spring-boot:build-image -P<environment>,但出现错误:

[INFO]     [creator]     Paketo BellSoft Liberica Buildpack 8.1.2
[INFO]     [creator]       https://github.com/paketo-buildpacks/bellsoft-liberica
[INFO]     [creator]       Build Configuration:
[INFO]     [creator]         $BP_JVM_VERSION              8.*             the Java version
[INFO]     [creator]       Launch Configuration:
[INFO]     [creator]         $BPL_JVM_HEAD_ROOM           0               the headroom in memory calculation
[INFO]     [creator]         $BPL_JVM_LOADED_CLASS_COUNT  35% of classes  the number of loaded classes in memory calculation
[INFO]     [creator]         $BPL_JVM_THREAD_COUNT        250             the number of threads in memory calculation
[INFO]     [creator]         $JAVA_TOOL_OPTIONS                           the JVM launch flags
[INFO]     [creator]       BellSoft Liberica JRE 8.0.292: Contributing to layer
[INFO]     [creator]         Downloading from https://github.com/bell-sw/Liberica/releases/download/8u292+10/bellsoft-jre8u292+10-linux-amd64.tar.gz
[INFO]     [creator]     unable to invoke layer creator
[INFO]     [creator]     unable to get dependency jre
[INFO]     [creator]     unable to download https://github.com/bell-sw/Liberica/releases/download/8u292+10/bellsoft-jre8u292+10-linux-amd64.tar.gz
[INFO]     [creator]     unable to request https://github.com/bell-sw/Liberica/releases/download/8u292+10/bellsoft-jre8u292+10-linux-amd64.tar.gz
[INFO]     [creator]     Get "https://github.com/bell-sw/Liberica/releases/download/8u292+10/bellsoft-jre8u292+10-linux-amd64.tar.gz": 
dial tcp: lookup github.com: Temporary failure in name resolution
[INFO]     [creator]     ERROR: failed to build: exit status 1

Run Code Online (Sandbox Code Playgroud)

在重新启动 docker 服务之前,我收到另一个错误:

[INFO]     [creator]     Get "https://repo.spring.io/release/org/springframework/cloud/spring-cloud-bindings/1.7.1/spring-cloud-bindings-1.7.1.jar": 
x509: certificate signed by unknown authority
[INFO]     [creator]     ERROR: failed to build: exit status 1
Run Code Online (Sandbox Code Playgroud)

我缺少什么配置?

Eng*_*uad 6

我在 Windows 上遇到类似的错误:

拨号tcp:查找objects.githubusercontent.com:i/o超时

将 DNS 更改为 1.1.1.1 解决了该问题。