'Getting error Docker invalid mode, trying to mount to container
I'm executing the next command:
docker run --rm -it -v https://github.com/rasilvap/lift-tool-test:/code ubuntu:20.04 bash
But I'm getting the next error message:
docker: Error response from daemon: invalid mode: /code.
My idea is to mount my repo inside the container in the code mount and then cd /code and execute some scripts.
It is possible to mount an online repo inside a mount container? in my case https://github.com/rasilvap/lift-tool-test
, maybe I'm misunderstanding something
Any ideas?
Thanks!
Solution 1:[1]
No this is not possible at all like that, easy way would be to clone the repo locally and then mount the local folder to it.
docker run --rm -it -v localfolderpath:/code ubuntu:20.0 bash
You could also forward your local ssh-agent to the container and have some kind of env variable with the link and clone it at the building process. But this option is very hard to do. If you have private repos if they are open source you don't even need to forward it you'd just need to build an image on top of ubuntu where you clone the repo during build time.
Here is the docker https://docs.docker.com/storage/volumes/ documentation.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | TD3V |