Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use a git url in a Dockerfile as base image?

I have tried things like:

FROM https://github.com/someone/somerepo.git#master:/

But it doesn't work. Any suggestion?

like image 984
AsTeR Avatar asked Oct 16 '25 13:10

AsTeR


1 Answers

The doc

https://docs.docker.com/engine/reference/builder/#from

says

The image can be any valid image – it is especially easy to start by pulling an image from the Public Repositories.

so either your

FROM

references an image available on your host, that you can see with a

docker images

or it references an image on the Docker Hub

https://hub.docker.com/

for example

https://hub.docker.com/_/debian/

or

https://hub.docker.com/_/ubuntu/

or

https://hub.docker.com/_/alpine/

or any other

So it seems, at the moment, you can't use a git repo

like image 96
user2915097 Avatar answered Oct 18 '25 07:10

user2915097



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!