What is '/host_mnt' and why does it not exist on my install?

I’m not able to start up my swarm with docker compose. The mount is failing – what I don’t understand is the path used for the mount. ‘/host_mnt’ does not exist on my system. Is it supposed to ?

Also, what’s up with the debug messages ? is that the normal format ?

Thanks in advance for any help

% docker compose --verbose up

DEBU[0000] Enabled Docker Desktop integration (experimental) @ unix:///Users/blackstrype/Library/Containers/com.docker.docker/Data/docker-cli.sock 
Attaching to confluence-1, gtask-1
Gracefully stopping... (press Ctrl+C again to force)
DEBU[0000] otel error                                    error="<nil>"
[+] Stopping 2/0
 ✔ Container my-proj-gtask-1       Stopped                                                                                                                                                                                                                            0.0s 
 ✔ Container my-proj-confluence-1  Stopped                                                                                                                                                                                                                            0.0s 
DEBU[0000] otel error                                    error="<nil>"
Error response from daemon: error while mounting volume '/var/lib/docker/volumes/my-proj_data/_data': failed to mount local volume: mount /host_mnt/Users/blackstrype/Documents/my-proj/data:/var/lib/docker/volumes/my-proj_data/_data, flags: 0x1000: no such file or directory

Note: I’ve just very recently upgraded my Docker Desktop version

Docker Compose version v2.29.2-desktop.2
System Version: macOS 14.6.1 (23G93)

You are using Docker Desktop, which means, everything is in a virtual machine. Including that /host_mnt which is the folder that contains the shared folders you added to Docker Desktop in the Resources / filesharing settings

The debug message could be okay, I don’t remember how it should look like, but I edited your post to format it like described in our formatting guide

Regarding the cause of the error, it seems that the folder does not exist that Docker wants to mount. how did you define the volume? Can you share that part of your compose file (also following the previously linked formatting guide and using code blocks)?

1 Like

Can you please resend me the link to the formatting guide ? The href is empty for the one in your reply. Is it this formatting guide ?

Here’s my compose:

x-common-tasks:
  &common-tasks
  build:
    context: ./
    dockerfile: Dockerfile.old

x-common-volumes:
  &common-volumes
  data:/usr/src/app/data

volumes:
  data:
    driver: local

services:
  gtask:
    <<: *common-tasks
    volumes:
      - *common-volumes
      - ./tasks/google-drive:/usr/src/app/

  confluence:
    <<: *common-tasks
    volumes:
      - *common-volumes
      - ./tasks/google-drive:/usr/src/app/

An “h” was missing from “http” in the URL and apparently the forum just uses an empty string in this case. I fixed it, but yes, you found it too.

Something is wrong here. According to the error message, you are trying to mount “data” from project directory as if the compose didn’t understand the value ofx-common-volumes and interpreted “data” as a local folder instead of a named volume. Try to define the volume like this to see if it helps:

- data:/usr/src/app/data

instead of

- *common-volumes

One other reason I can imagine is that you had a different volume definition, chaned it in the compose file but the volume with the same name already crated was not deleted.