docker如何從github上build映像
伊谢尔伦
伊谢尔伦 2017-04-21 10:57:53
0
1
947

官方文檔中有這麼個例子:

docker build github.com/creack/docker-firefox

可以看到上麵的docker-firefox是一個repository並且有一個Dockerfile文件。現在我想從github上build一個redis到本地鏡像(並且隻需要2.8.10這個版本)
那為什麼我這個不行呢:

# docker build github.com/docker-library/redis/tree/99c172e82ed81af441e13dd48dda2729e19493bc/2.8.10
2014/11/05 16:20:32 Error trying to use git: exit status 128 (Initialized empty Git repository in /tmp/docker-build-git067001920/.git/
error: The requested URL returned error: 403 while accessing https://github.com/docker-library/redis/tree/99c172e82ed81af441e13dd48dda2729e19493bc/2.8.10/info/refs

fatal: HTTP request failed
)

这样子也不行
# docker build https://github.com/docker-library/redis/blob/99c172e82ed81af441e13dd48dda2729e19493bc/2.8.10/Dockerfile
2014/11/05 16:22:43 Invalid Dockerfile format

請問你該如何寫build?

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

全部回覆(1)
刘奇

問題在於沒有正確存取Dockerfile,讓你的主機先能正常存取github先

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板