docker如何从github上build镜像

 mobiledu2502874965 发布于 2022-10-25 17:39

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

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?

1 个回答
  • 问题在于没有正确访问到Dockerfile,让你的主机先能正常访问github先

    2022-10-26 23:42 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有