[Day 14] - 『转职工作的Lessons learned』 - Docker Build Issue

今天的笔记应该算是日常初阶工程师会发生的问题,以及可以怎麽去找根因的一些做法,不外乎就是下好关键字,然後去实验网路上的solution是否可以解答我的情况。

Dockerfile Build Issue

近期工作发生了这个issue,当我在local环境使用docker去build一个image档时,却发生了以下的Issue

❯ docker build -t test3/test3 .
[+] Building 9.7s (2/3)                                                           
 => [internal] load build definition from Dockerfile                         0.0s
 => => transferring dockerfile: 37B                                          0.0s
[+] Building 10.3s (3/3) FINISHED                                      => [internal] load build definition from Dockerfile             0.0s
 => => transferring dockerfile: 37B                              0.0s  => [internal] load .dockerignore                                0.0s
 => => transferring context: 2B                                  0.0s  => ERROR [internal] load metadata for docker.io/library/node:  10.2s
------
 > [internal] load metadata for docker.io/library/node:14-alpine:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to do request: Head https://registry-1.docker.io/v2/library/node/manifests/14-alpine: net/http: TLS handshake timeout

Local docker build

关键字:failed to solve with frontend dockerfile.v0

利用以上关键字找到了一篇stackoverflow当中的solution有写道:
DOCKER_BUILDKIT=0 docker build .可以更精确的知道错误是什麽(参考网址

实际command後出现以下问题,可能是TLS timeout 问题。

❯ DOCKER_BUILDKIT=0  docker build .
Sending build context to Docker daemon  130.6MB
Step 1/12 : FROM node:14-alpine
Get https://registry-1.docker.io/v2/: net/http: TLS handshake timeout

关键字:Get https://registry-1.docker.io/v2/: net/http: TLS handshake timeout

後续在例用以上关键字去搜索,找到了以下的解释:

net/http: TLS handshake timeout means that you have slow internet connection. Default value of connection timeout is too small for your environment. Unfortunately docker don't have any settings that allows you change connection timeout. You may try to create your own registry cache somewhere else and pull images from it.
(net/http: TLS handshake timeout意味着您的互联网连接速度较慢。连接超时的默认值对於您的环境来说太小了。不幸的是,docker 没有任何允许您更改连接超时的设置。您可以尝试在其他地方创建自己的注册表缓存并从中提取图像。)(参考网址

Solution (参考网址)

  1. Check internet speed and connect to Faster Internet
    => it works!!!!!!!!

  2. Restart Docker
    => Useless

  3. Reset Daemon Settings
    => To be check...


Gitlab docker build

关键字: gitlab cicd pending at fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz

issue is related to Alpine image having networking issues when run in Docker-in-Docker configuration on Kubernetes/OpenShift based runner.
(发现此问题与在基於 Kubernetes/OpenShift 的运行器上以 Docker-in-Docker 配置运行时存在网络问题的 Alpine 映像有关。)

apk fetch hangs #307

Gitlab.com CI/CD stuck

2021-09-25: Outbound network connectivity issues on CI runners

Solution

  1. Append --network host to the build command
    => Added it to docker client commands,docker build --network host. Modify .gitlab-ci.yaml file to have docker build --network host

  2. Google working on it...

Test failures starting 22 September due to network timeouts #23741

After reviewing the information you provided, we believe that you may be affected by a known issue: We have identified a Networking connecting issue impacting the GKE Docker workload. This is a high priority issue that we're working to resolve as soon as possible. Some customers may be experiencing a connection failure in Docker workflow to Fastly destinations and may receive a timeout error.
(在查看您提供的信息後,我们认为您可能受到一个已知问题的影响:我们发现了一个影响 GKE Docker 工作负载的网络连接问题。 这是一个高度优先的问题,我们正在努力尽快解决。 一些客户可能会在 Docker 工作流中遇到 Fastly 目标的连接失败,并且可能会收到超时错误。)

Google Cloud incident

Global: We have identified a Networking connectivity issue that impacts Docker workloads inside GKE and potentially GC(全球:我们发现了一个网络连接问题,该问题会影响 GKE 内的 Docker 工作负载并可能影响 GC)

Try and Error
3. Specify specific version of alpine and comment out RUN apk update
=> it works


<<:  Day 13 - 密码破解软件初体验

>>:  【从实作学习ASP.NET Core】Day16 | 後台 | 会员的角色

[Day 7] 系统功能规划

今天来聊聊系统开发前要做哪些事 还有接到需求後,要怎麽根据需求去设计系统架构 通常在开发系统前,都会...

专业人士可以实现员工入职流程自动化的方式

亚当·贝特拉姆(Adam Bertram)解释了自动化新员工入职过程的好处。 不论全新租赁的角色如何...

Html元素-清单&表格(DAY4)

建立清单或表格的用意,可以把资料排序得更加整齐,让人一看到就能浅显易懂,若想要让资料更方便阅读或是有...

Day17边框(CSS)

Border 边框样式 今天来介绍个基本的边框 <p class="solid &q...

DAY7 浅扒网路 - 估计被扒皮的是我不是网路

「将127.0.0.1改成内网IP」,这是上一篇的某个步骤,没浅浅扒一下网路基础,对学习有点影响~~...