Drone: invalid mount config for type "bind"

Created on 11 Jun 2019  路  4Comments  路  Source: drone/drone

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.

critical

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)

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.

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jpillora picture jpillora  路  6Comments

xoxys picture xoxys  路  4Comments

Dentrax picture Dentrax  路  5Comments

dwojcAVI picture dwojcAVI  路  5Comments

donny-dont picture donny-dont  路  5Comments