I'm building an SpringBoot image on macOS through docker using:
./gradlew bootBuildImage
I get an error of dial tcp: lookup github.com: i/o timeout at the Paketo Buildpack for BellSoft Liberica 10.2.6 step:
[creator] Paketo Buildpack for BellSoft Liberica 10.2.6
[creator] https://github.com/paketo-buildpacks/bellsoft-liberica
[creator] Build Configuration:
...SNIP...
[creator] Using Java version 20 from BP_JVM_VERSION
[creator] BellSoft Liberica JRE 20.0.1: Contributing to layer
[creator] Downloading from https://github.com/bell-sw/Liberica/releases/download/20.0.1+10/bellsoft-jre20.0.1+10-linux-amd64.tar.gz
[creator] unable to invoke layer creator
[creator] unable to get dependency jre
[creator] unable to download https://github.com/bell-sw/Liberica/releases/download/20.0.1+10/bellsoft-jre20.0.1+10-linux-amd64.tar.gz
[creator] unable to request https://github.com/bell-sw/Liberica/releases/download/20.0.1+10/bellsoft-jre20.0.1+10-linux-amd64.tar.gz
[creator] Get "https://github.com/bell-sw/Liberica/releases/download/20.0.1+10/bellsoft-jre20.0.1+10-linux-amd64.tar.gz": dial tcp: lookup github.com: i/o timeout
[creator] ERROR: failed to build: exit status 1
> Task :bootBuildImage FAILED
FAILURE: Build failed with an exception.
The weird thing is that I can download the image using my browser when I click on the link https://github.com/bell-sw/Liberica/releases/download/20.0.1+10/bellsoft-jre20.0.1+10-linux-amd64.tar.gz
This might be a bug in Docker Desktop or otherwise related to DNS misconfiguration.
I managed to fix the issue by adding the following line to Docker Engine config file
"dns": ["1.1.1.1","8.8.8.8"],as suggested in this related answer.This is where one can find the setting: