Hi <@ULVA73B9P>. I have some workers that have a d...
# ask-marvin
f
Hi @Marvin. I have some workers that have a disk mounted as /data. I want to include it in my docker pool as mounted disk, however is not mounted as bind so it's not usable. where is the issue here? "volumes": { "type": "array", "items": { "type": "string" }, "title": "Volumes", "default": [ "/var/run/docker.sock:/var/run/docker.sock", "/data:/data" ], "examples": [ "/my/local/path:/path/in/container" ], "description": "A list of volume to mount into created containers." }, in the vm, this is the mount: sda 931.5G disk └─sda1 931.5G part /data ext4 f0fcff50-764f-402d-b314-ad191f0206c0 inside of my flow: @docker( _work_pool_="xxx-cluster", image="xxx/xxx:latest", ) @flow(_persist_result_=True, _result_storage_=s3_bucket_block) def *process_blocks*(): print("...!") I got the following infos: ============================================================ 114858.006 | INFO | Flow run 'merry-aardwolf' - Detailed information about /data mount: 114858.009 | INFO | Flow run 'merry-aardwolf' - ============================================================ 114858.010 | INFO | Flow run 'merry-aardwolf' - /data exists 114858.011 | INFO | Flow run 'merry-aardwolf' - Is directory: True 114858.012 | INFO | Flow run 'merry-aardwolf' - Is file: False 114858.013 | INFO | Flow run 'merry-aardwolf' - Is symlink: False 114858.015 | INFO | Flow run 'merry-aardwolf' - Mount device: overlay 114858.016 | INFO | Flow run 'merry-aardwolf' - Mount point: /data 114858.017 | INFO | Flow run 'merry-aardwolf' - Filesystem: overlay 114858.019 | INFO | Flow run 'merry-aardwolf' - Mount options: rw,relatime,lowerdir=/tmp/docker-desktop-root-ro,upperdir=/run/rootfs.upper,workdir=/run/rootfs.workdir,uuid=on 114858.020 | INFO | Flow run 'merry-aardwolf' - 114858.021 | INFO | Flow run 'merry-aardwolf' - Listing contents of /data: 114858.023 | INFO | Flow run 'merry-aardwolf' - Found 0 items in /data 114858.024 | WARNING | Flow run 'merry-aardwolf' - /data is empty - this might be an empty overlay mount 114858.026 | WARNING | Flow run 'merry-aardwolf' - The host /data may not be properly bind-mounted into the container 114858.912 | INFO | Flow run 'merry-aardwolf' - Finished in state Completed()
m
thought for 205.6 seconds
Short answer: your flow runs are not being started by the Docker daemon on the VM that has /data mounted. They’re being launched by a Docker Desktop daemon (evidenced by lowerdir=/tmp/docker-desktop-root-ro in your mount output), so the container can’t bind /data from your VM and you see an empty overlay instead. Why this happens - Docker work pools start containers on whatever Docker daemon the worker is talking to. If the worker is running on your laptop (or is pointed at Docker Desktop) and not at the VM’s Docker engine,
/data:/data
will try to bind a path that doesn’t exist on that host. - On macOS/Windows with Docker Desktop, you also can’t bind arbitrary root paths like /data; only shared host directories (e.g., under /Users on macOS) are allowed unless explicitly configured. What to check/fix 1) Confirm which Docker daemon your worker is using - On the machine running the Prefect worker, run:
Copy code
docker info
  docker version
  echo $DOCKER_HOST
If you see “docker-desktop” or your DOCKER_HOST points to your local machine, that’s the wrong daemon for binding /data on the VM. - In the Prefect UI, open a recent flow run -> Job details and check the Docker “Mounts” reported. It should show Type: bind and Source: /data for a correct bind mount. 2) Ensure the worker uses the VM’s Docker daemon - Run the Prefect worker on the VM that has /data mounted and ensure it uses the VM’s local Docker engine (no DOCKER_HOST pointing elsewhere). - If you must run the worker off-box, set DOCKER_HOST/DOCKER_TLS_VERIFY/DOCKER_CERT_PATH to point to the VM’s Docker daemon (securely), so the containers are created on the VM. 3) If you actually intend to use Docker Desktop - Use a host path that Docker Desktop can share (e.g., /Users/you/data:/data on macOS) and enable file sharing in Docker Desktop settings. - Docker bind-mount docs: Bind mounts - Docker Desktop file sharing (macOS example): File sharing settings 4) Optional: use a named volume bound to /data (on Linux VM) - On the VM, create a named volume that binds to /data:
Copy code
docker volume create \
    --driver local \
    --opt type=none \
    --opt device=/data \
    --opt o=bind \
    data_volume
- In your Docker work pool’s volumes, use:
Copy code
data_volume:/data
This still requires the worker to use the VM’s Docker daemon, but it avoids Docker auto-creating empty host dirs. 5) Double-check how volumes are set in the pool - Make sure you’ve set the “volumes” value in the pool’s job variables (or in the decorator), not just the JSON schema defaults. In the Prefect UI, go to Work Pools -> your pool -> Edit -> Job variables and confirm it shows:
Copy code
[
    "/var/run/docker.sock:/var/run/docker.sock",
    "/data:/data"
  ]
Quick sanity test on the correct host - On the VM with /data:
Copy code
docker run --rm -v /data:/data alpine sh -c "mount | grep ' /data '; ls -la /data"
You should see a bind mount and the expected contents. If you share: - Where your Prefect worker process is running - The value of DOCKER_HOST for that worker (if set) - A snippet of the “Mounts” section from docker inspect of a Prefect-launched container …I can pinpoint the exact misrouting and suggest the minimal change.