Skip to content

Instantly share code, notes, and snippets.

@joecwu
Created November 21, 2015 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joecwu/85d31be6b0d3d1edd936 to your computer and use it in GitHub Desktop.
Save joecwu/85d31be6b0d3d1edd936 to your computer and use it in GitHub Desktop.
[Docker] Push Error
published tags
true
Docker

[Docker] Push Error

這篇同步發佈在我的BlogGist

背景

上一篇Docker Private Registory提到,在公司架了Docker Registory,基於安全考量,Port當然是沒有對外開放,而平常在家裡要連回公司,就是使用VPN連到公司來存取公司內部的Services。

由於目前草創初期,CI還沒架設起來,所以目前是使用local build & publish到Docker Repository。

問題

今天在家裡改完了一些Code,要把build上傳到公司的Docker Registry的時候,發現了下面的錯誤:

Joes-MBP:admin-backend-api joecwu$ docker push {host}:{port}/xxx/admin-backend-api:0.1.17
The push refers to a repository [{host}:{port}/xxx/admin-backend-api] (len: 1)
Sending image list
Put http://{host}:{port}/v1/repositories/xxx/admin-backend-api/: dial tcp: lookup {host} on 192.168.70.254:53: read udp 192.168.70.254:53: i/o timeout

明明已經連到公司的VPN了,IP也ping得到,192.168.70.254是gateway,也都能正常連到他,為什麼會有這樣的錯誤?

解法

這讓我想到了在公司有一台開發機,是使用無線網卡連公司的網路,有時無線網卡會不穩,網路會斷掉再重連,而這時這台開發機裡所架設的docker-machine會無法從外部連到,必需重新啟動docker-machine(也就是virtual box的VM),讓VM的網路組態重新更新之後才能正常存取。

因此簡單的把我的Mac上的docker-machine restart,之後這個問題就解決了,就能正常的上傳build嘍!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment