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

Example docker run command creates 50-server.cnf as a directory instead of file #22

Closed
jstevensen opened this issue Dec 21, 2017 · 4 comments

Comments

@jstevensen
Copy link

Thank you for producing a docker container for librenms! I was testing this out last night and I've found that the use of relative paths in the docker run command end up creating a directory instead of a file.

Running this command:
docker run -d -m 1g
-v pwd/mysql:/var/lib/mysql
-v pwd/50-server.cnf:/etc/mysql/mariadb.conf.d/50-server.cnf:ro
-e MYSQL_ROOT_PASSWORD=pwd4librenms
--name librenms-db
mariadb:latest

Creates 50-server.cnf as directory, instead of a folder.

Modifying the command to specify the full path results in 50-server.cnf being created as a file, as I believe is intended.

I found useful information in this post:
moby/moby#24408

@setiseta
Copy link
Owner

Thank you for the information.
I've corrected the Readme with commit 221b5d2
It would be nice if you can retest, and give some feedback.

@jstevensen
Copy link
Author

Hi,

Tested this change. Unfortunately, the directory 50-server.cnf is still created.

From https://docs.docker.com/engine/admin/volumes/bind-mounts/

If you use -v or --volume to bind-mount a file or directory that does not yet exist on the Docker host, -v will create the endpoint for you. It is always created as a directory.

I'm not sure if there is a way around this when 50-server.cnf does not exist.

@RalfHerzog
Copy link
Contributor

The only solution would be an extra database image I think. There is nothing against it but one more dependency to maintain

@setiseta
Copy link
Owner

you need to take the 50-server.cnf from repo, and place it on the mounted path.
then it won't generate a directory.

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

3 participants