问题:
通过 docker build构建SpringBoot镜像时出现如下问题:文章来源:https://www.toymoban.com/news/detail-627712.html
[root@localhost docker]# docker build -t example:1.0.0 .
[+] Building 36.0s (3/3) FINISHED
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load build definition from dockerfile 0.0s
=> => transferring dockerfile: 290B 0.0s
=> ERROR [internal] load metadata for docker.io/library/java:8 35.9s
------
> [internal] load metadata for docker.io/library/java:8:
------
dockerfile:2
--------------------
1 |
2 | >>> FROM java:8
3 |
4 | MAINTAINER GaoHuanjie
--------------------
ERROR: failed to solve: java:8: failed to do request: Head "https://ha65u7j9.mirror.aliyuncs.com/v2/library/java/manifests/8?ns=docker.io": dial tcp: lookup ha65u7j9.mirror.aliyuncs.com on 114.114.114.114:53: read udp 192.168.1.101:52193->114.114.114.114:53: i/o timeout
[root@localhost docker]#
方案:
该问题由网络不好产生,可以更换网络环境尝试一下,如果还是没有解决,可以通过修改dockerfile文件FROM配置尝试一下,如下所示:文章来源地址https://www.toymoban.com/news/detail-627712.html
FROM openjdk:8
MAINTAINER GaoHuanjie
VOLUME /tmp
ADD dubhe-0.0.1-SNAPSHOT.jar app.jar
RUN bash -c 'touch /app.jar'
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
到了这里,关于ERROR: failed to solve: java:8: failed to do request:的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!