Fix issues where bind mount fails if path does not exist on the host machine. This is related to how drone-runtime changed how it configured docker volumes when invoking the Docker API.
Oh nice! 馃憤 wondered if it was something to do between drone/docker/moby, just didn't have time to investigate it...
For others, this was our quick workaround in the meantime:
volumes:
- name: tmp
host:
path: /tmp
- name: cache
host:
path: /tmp/cache_${DRONE_COMMIT_BRANCH}/vendor
steps:
- name: prime-cache-folder
image: alpine:latest
commands:
- mkdir -p /lib/var/tmp/cache_${DRONE_COMMIT_BRANCH}/vendor
volumes:
- name: tmp
path: /lib/var/tmp
- name: cache-dep-restore
image: drillster/drone-volume-cache
settings:
restore: true
mount:
- /drone/src/github.com/drone/drone/vendor
volumes:
- name: cache
path: /cache
...
this is fixed right now in v1.2.2 and in master but you need to use a feature flag to enable. This should be passed to the agent (or the server in single-server mode)
DRONE_FEATURE_VOLUME_SET=true
volumes are tricky because there are 4 different types (tempfs, bind mount, data volume and npipe) and the logic to decide which-is-which is confusing and the code is more awkward than I would like. We placed this fix behind a feature flag to reduce the risk of a regression. We will remove the feature flag in 1.3.0 once I have confirmation that it is working as expected for people.
Setting the feature flag solved the issue for me on 1.2.3 while using named volumes :+1:
removed feature flag and merged into master, available in :latest and will be available in 1.3 which should be tagged today or tomorrow.
Most helpful comment
this is fixed right now in v1.2.2 and in master but you need to use a feature flag to enable. This should be passed to the agent (or the server in single-server mode)
volumes are tricky because there are 4 different types (tempfs, bind mount, data volume and npipe) and the logic to decide which-is-which is confusing and the code is more awkward than I would like. We placed this fix behind a feature flag to reduce the risk of a regression. We will remove the feature flag in 1.3.0 once I have confirmation that it is working as expected for people.