Mounting Named Volumes

What’s the best approach to mounting a docker named volume? I’m aiming to keep my Apache Airflow dags up to date using Drone. The repo I’m copying from is laid out like this:

airflow/
+-- dags/
|   +-- dag_one.py
+-- .drone.yml

With bind mounting this approach worked well for me:

kind: pipeline
name: default

clone:
  depth: 50

steps:
- name: copy
  image: bash
  volumes:
  - name: dags
    path: /dags
  commands:
  - cp -R ./dags /

volumes:
- name: dags
  host:
    path: /volume1/docker/airflow_data/airflow/dags

I’ve switched over to Docker Volumes to manage some Airflow requirements. I spotted this example in the archived Drone yaml repo but I wasn’t able to update this for Drone 1.0+. The docstring on this function refers to the --volume=host:container format - how should we apply this in .drone.yml?

1 Like

There is currently no support for external, named docker volumes. You would need to use a host volume mount for this.