Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker run doesn't work #2978

Open
JavierYepez opened this issue Jan 12, 2024 · 4 comments
Open

Docker run doesn't work #2978

JavierYepez opened this issue Jan 12, 2024 · 4 comments

Comments

@JavierYepez
Copy link

I'm trying to run a simple instance of mosquitto with the following command (taken from the docker page, examples):

docker run -it -p 1883:1883 -p 9001:9001 -v mosquitto.conf:/mosquitto/config/mosquitto.conf eclipse-mosquitto

And gives me the following error:
docker: Error response from daemon: source /var/lib/docker/overlay2/7afb6a2079ceaf6bc03bb9c5c35122ba077e8c4ed90da30d96e945d4452e6869/merged/mosquitto/config/mosquitto.conf is not directory. See 'docker run --help'.

Running on a 2019 MacBook
Docker Desktop: 4.25.2

@dopefishh
Copy link

I also ran into this and figured out that you need to use a full path. E.g.:

docker run -it -v $PWD/mosquitto.conf:/mosquitto/config/mosquitto.conf -p 1883:1883 -p 9001:9001 eclipse-mosquitto

@JavierYepez
Copy link
Author

But that's weird, it should work with the relative path though. I was launching Mosquitto from a Docker Compose and it doesn't makes sense to use absolute path.
Is there a way to do $PWD when mounting from a Docker Compose file?

@dopefishh
Copy link

I don't know whether a full path is required in Docker Compose, only that it is required when using the docker directly.
The docker documentation (https://docs.docker.com/storage/bind-mounts/) also states:

... The file or directory is referenced by its absolute path on the host machine. ...

@JavierYepez
Copy link
Author

Then they should update/fix their examples here https://hub.docker.com/_/eclipse-mosquitto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants