>  Q&A  >  본문

docker如何从github上build镜像

官方文档中有这么个例子:

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?

伊谢尔伦伊谢尔伦2710일 전850

모든 응답(1)나는 대답할 것이다

  • 怪我咯

    怪我咯2017-04-21 10:59:53

    문제는 Dockerfile에 올바르게 액세스되지 않는다는 것입니다. 호스트가 정상적으로 github에 액세스할 수 있도록 하세요.

    회신하다
    0
  • 취소회신하다