Hi, as per documentation and other posts I see that mounting existing docker volumes is not possible.
Is this feature planned ?
Is there an easy workaround ?
You can mount Host Volumes as mentioned in below doc:
https://docs.drone.io/pipeline/docker/syntax/volumes/host/
Let us know if this will not help in your case and provide more details around what exactly you are referring when you say “mounting existing docker volumes”.
Regards,
Harness Support
If I understand correctly, this documentation shows how to bind a host folder to a volume in drone and “assign” this created volume to a step.
What I’m referring to is: I have a docker volume created in docker and I want to use this volume to “assign” it to a step.
Example usage: Drone builds a website with hugo and put the generated files in a volume being used and watched by a webserver in a container. (without having to restart nor move any file after)
Edit: by “existing docker volumes” I mean volumes created outside drone pipeline
After reading a bit of documentation the only workaround I see would be to use an ‘exec’ type pipeline and enter docker commands directly.
But as I use drone & drone runners in containers I’m not sure if it is very feasible.
Does the drone runner use the docker API? Would I need to add the docker client to the runner container?
Oh ‘exec’ type pipelines use ‘drone-runner-exec’ so that means installing a service on the root OS.
As I understand the ‘drone-runner-docker’ is able to mount volumes that are defined in the pipeline.
It would be an nice feature to be able to define an external volume, like in docker compose.
Something like:
volumes:
- name: content
external:
name: mysite_org_content
Edit: after reading a bit of source code it looks like this feature would need changes in drone
, drone-runtime
& drone-yaml
projects to handle. How (& where) could I create a feature request?