build dockerfile 報(bào)錯(cuò)TLS handshake timeout:詳情如下
sniper:docker chris$ docker build -t hello_docker .
Sending build context to Docker daemon 2.048 kB
Step 1 : FROM alpine:latest
latest: Pulling from library/alpine
ff3a5c916c92: Pulling fs layer
error pulling image configuration: Get https://dseasb33srnrn.cloudfront.net/registry-v2/docker/registry/v2/blobs/sha256/3f/3fd9065eaf02feaf94d68376da52541925650b81698c53c6824d92ff63f98353/data?Expires=1523738136&Signature=GGO8hMm1ynJNw9ErJWM94xUBscpWHAGw38i5mNW1W69nVcfoIP43~rdAuwLfxXeHfTXnO0HVXdSfxwCkO7VskyJKVMtZmWIjTCkoZqhLppz3sn30cvBvxtzCCLZAuWCM60e51UAgMqMbss4EKL5J4gxb8gKvtYcHqNG0lTSMBt0_&Key-Pair-Id=APKAJECH5M7VWIS5YZ6Q: net/http: TLS handshake timeout
TLS handshake timeout的原因是從dockerhub拉取鏡像失敗,需要做一個(gè)加速,加速器可以用國(guó)內(nèi)的阿里加速器,注冊(cè)一個(gè)阿里云的賬號(hào),獲取自己的專屬加速地址。

右鍵點(diǎn)擊桌面頂欄的 docker 圖標(biāo),選擇 Preferences ,在 Daemon 標(biāo)簽(Docker 17.03 之前版本為 Advanced 標(biāo)簽)下的 Registry mirrors 列表中將你的專屬加速地址加到"registry-mirrors"的數(shù)組里,點(diǎn)擊 Apply & Restart按鈕,等待Docker重啟并應(yīng)用配置的鏡像加速器。
成功解決:
