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 installation, config.yml being bound to directory? #83

Closed
blasphemite opened this issue Jun 9, 2020 · 9 comments · Fixed by #94
Closed

Docker installation, config.yml being bound to directory? #83

blasphemite opened this issue Jun 9, 2020 · 9 comments · Fixed by #94

Comments

@blasphemite
Copy link

blasphemite commented Jun 9, 2020

Using the docker run command from the readme, changing the directories and adding the -d option.

docker run -d -p 8803:8080 -v /container/config.yml:/www/config.yml -v /container/assets/:/www/assets b4bz/homer:latest

(copy assets directory to local assets directory)

Local /container/config.yml is created as a directory.

If I remove the local config.yml directory and manually replace it with a default config file, I get errors about binding a volume to a file.

If I create the config.yml prior to creating the container, I get a "404 page not found" error.

@JamiePhonic
Copy link
Contributor

JamiePhonic commented Jun 9, 2020

Try this:

first, create a homer folder inside your /container/ folder and place the files inside it:

/container/homer/assets/
/container/homer/config.yml

then run:

chmod -R 774 /container/homer/
docker run -d --name='homer' -p '8066:8080' -v '/container/homer/assets/':'/www/assets':'rw' -v '/container/homer/config.yml':'/www/config.yml':'rw' 'b4bz/homer:latest' 

The --name parameter isnt required, i just like to properly name my containers so i can identify multiple instances of the same container

@blasphemite
Copy link
Author

I actually do have the homer files in it's own folder. The directory is more like /docker/homer/assets/ etc.

chown and chmod on homer folder, then running:

docker run -d --name='homer' -p '8066:8080' -v '/docker/homer/assets/':'/www/assets':'rw' -v '/docker/homer/config.yml':'/www/config.yml':'rw' 'b4bz/homer:latest'

and config.yml is still created as a directory.

@Aimsucks
Copy link

Yes, he's saying you need to create config.yml inside /docker/homer/ because volumes are meant to be mapped to folders and not files. It will work, however, if you try to mount an existing file to the container.

@JamiePhonic
Copy link
Contributor

Yes, if mapping a file, the file MUST exist before starting the container, otherwise docker will usually assume It's a folder.
Also make sure the file has the correct permissions so docker can access it.

Your're not the only one to experience this issue, for example, in #50, the OP was having the same issue running on a synology NAS. Creating the config.yml file before starting the container seemed to work.

On the other hand, I'm running on Unraid and never ran In to this issue at all.

I think part of it may be down to how docker Is implemented/managed within a perticular OS, but thats just a theory.

@bastienwirtz
Copy link
Owner

Hi there!

Yeah, it not ideal, I think in the future I'll move the config.yml in the assets folder (maybe also change the name of this folder), all editable / customizable files should be in the same place. I never considered it would run in docker at some point, so file organization could have been better 😅

I'll think about it, might be possible to get a clean file organization and run a little script to migrate old installations and avoid to break everyone's dashboard!

@Aimsucks
Copy link

Something else to consider is on initial start to create a default configuration file in the mapped folder.

@bastienwirtz
Copy link
Owner

@Aimsucks Yeah that's definitely the plan, I'm gonna push that asap.

@GlennToms
Copy link
Contributor

I mount /www folder and every thing get copied in on first startup and then your good to go. This is how I've all ways used Homer.

Using this as the mount point address most of the concerned above and with merge #87 config is now created if missing.
Let me know if you still having issues with the newest version.

@bastienwirtz
Copy link
Owner

Hi there!

This #83 should simplify the docker setup. Any feedback welcomed!

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

Successfully merging a pull request may close this issue.

5 participants