是否可以從Github存儲庫上的非主分支構建圖像?Docker:如何從Github存儲庫上的非主分支構建圖像
例如,我擁有存儲庫//github.com/myAccount/docker-myImage
,並且我想用於我的圖像的分支development
。不幸的是,下面的命令似乎只讓建築從master
分支:
docker build -t myAccount/myImage git://github.com/myAccount/docker-myImage
這裏是man docker build
相關文件:
Building an image using a URL
This will clone the specified Github repository from the URL and use it as context.
The Dockerfile at the root of the repository is used as Dockerfile. This only works
if the Github repository is a dedicated repository.
docker build github.com/scollier/Fedora-Dockerfiles/tree/master/apache
Note: You can set an arbitrary Git repository via the git:// schema.
也許有另一種,像docker build -t myAccount/myImage git://github.com/myAccount/docker-myImage:development
?
其實,這是行不通的。例如,當我執行上述命令時,出現錯誤:'repository 'https://github.com/fedora-cloud/Fedora-Dockerfiles/tree/master/apache/' not found' – modulitos