一些git存储库有一个Dockerfile。用户可以键入:
sudo docker build -t opensfm https://github.com/mapillary/OpenSfM.git
码头工人开始建造。
这是怎么做到的?
当我们将相同的Dockerfile放入存储库并尝试构建它时:
docker build -t exchange https://github.com/atursams/exchange.git
我们得到:
unable to prepare context: unable to 'git clone' to temporary context directory: error fetching: fatal: couldn't find remote ref master
错误为"找不到远程引用主机";,实际上,您的存储库没有master
分支。幸运的是,文件中提到了这种情况;只需将分支名称作为URL的一部分:
docker build -t exchange https://github.com/atursams/exchange.git#main
此外,您的存储库当前没有Dockerfile
。
您的存储库不包含名为"主";(你的名字叫main(