# Mount docker volume as the base git-repository (and skip git-clone)

**URL:** <https://drone.discourse.group/t/mount-docker-volume-as-the-base-git-repository-and-skip-git-clone/7482>\
**Category:** Drone Support\
**Created:** [September 27, 2018, 10:00am UTC](https://drone.discourse.group/t/mount-docker-volume-as-the-base-git-repository-and-skip-git-clone/7482 "2018-09-27T10:00:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![typeless](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/typeless/32/5491_2.png) [@typeless](https://drone.discourse.group/u/typeless)\
**Post date:** [September 27, 2018, 10:00am UTC](https://drone.discourse.group/t/mount-docker-volume-as-the-base-git-repository-and-skip-git-clone/7482/1 "2018-09-27T10:00:06Z")

</div>

I found [Support for --volumes-from?](http://discuss.harness.io/t/support-for-volumes-from/514) and following the links like [http://docs.drone.io/docker-volumes/](http://docs.drone.io/docker-volumes/).

But what I want is for the git repository rather than some prebuilt binaries as the codebase is too large to clone for every build.

I also noticed that the drone-git plugin would check the emptiness of the git folder ([https://github.com/drone-plugins/drone-git/blob/master/plugin.go#L41](https://github.com/drone-plugins/drone-git/blob/master/plugin.go#L41)), so it seems possible to prepare the code repo, letting the drone-git plugin skip the git-clone step.

Is this a sane approach for my purpose?  
How can I specify the mount point for code in the drone.yml and make drone mount it first before doing git-clone?

---

<div class="post-metadata">

**Author:** ![glynternet](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/glynternet/32/4650_2.png) [@glynternet](https://drone.discourse.group/u/glynternet)\
**Post date:** [September 27, 2018, 8:30pm UTC](https://drone.discourse.group/t/mount-docker-volume-as-the-base-git-repository-and-skip-git-clone/7482/2 "2018-09-27T20:30:54Z")

</div>

Have you seen the following documentation page?  
[http://docs.drone.io/cloning/](http://docs.drone.io/cloning/)

It seems that you can provide a custom clone step, which you could make use of to provide the data from your other volume perhaps.

I’m sure someone else will be able to jump in with a more concrete example, perhaps this may be able to get your somewhere, though.

---

<div class="post-metadata">

**Author:** ![typeless](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/typeless/32/5491_2.png) [@typeless](https://drone.discourse.group/u/typeless)\
**Post date:** [September 28, 2018, 1:47am UTC](https://drone.discourse.group/t/mount-docker-volume-as-the-base-git-repository-and-skip-git-clone/7482/3 "2018-09-28T01:47:02Z")

</div>

Yes, I have seen the page.

By ‘custom a clone step,’ do you mean to write a customized plugin?  
I cannot find the configuration that fits my purpose in the documentation without resorting to writing my customized plugin.

Edit: found a similar question [[Fixed] Big repo, how to save the git clone time?](http://discuss.harness.io/t/fixed-big-repo-how-to-save-the-git-clone-time/1057/4). Unfortunately, the depth=1 options is not helpful enough.
