-
Notifications
You must be signed in to change notification settings - Fork 317
Ownership of the data directory #19
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
Comments
Most people do not set proper permissions on mounted directories for a non-root user to be able to access or change the files, so we have to Two options:
|
Maybe most people are bad at use permissions (proof?), but for people doing it well it's a totally unwanted behavior: if I put files in my $HOME, in my $USER directory with initaly a good chown of my $USER, it's bug that I can't edit these files without su(do) rights. |
Here is a sample of many users that have issues with permissions of mounted files:
We try to make the images simple to run and work for most cases; there were discussions to have something like |
@yosifkit is the group set to 0 because of the call to |
Got burnt by this pretty bad. Had no idea why docker was changing the owner of my folder to a totally uninvolved user. Just so happens it was the user with id 1000. What can we do to make sure no one else loses time on this? |
This inability to have files reflect outside permissions is rather unfortunate - the entire point of docker (to my mind) is delegation of configuration and tweaking of software to a competent third party while allowing me to update when necessary (i.e. bump the image tag). Forking the image is drastic and questions the existence of the image itself, it's little better than a good blog post by then. |
I am facing a similar issue. Whenever I run this container, the Due to this I have to chown it back to my user whenever I want to edit the files, and whats worse is that git fails to change the files when switching branches, thus I have to chown and then discard changes to get back the clean state of the branch. Is there any solution to avoid this, other than changing my user id, or using sudo for everything involving that folder? |
You can create a group which can be used to make the files writable for you. Then you can edit the files and don't run into any problem because group ownership is not touched by the image. |
Additionally, as of #54 (which I've just now verified with Ghost 1.x as well), you're able to run Ghost itself as any arbitrary user, so using $ docker run -it --rm --user 1000:1000 ghost:alpine
[2017-09-26 22:20:34] INFO Creating table: posts
[2017-09-26 22:20:34] INFO Creating table: users
[2017-09-26 22:20:35] INFO Creating table: roles
[2017-09-26 22:20:35] INFO Creating table: roles_users
[2017-09-26 22:20:35] INFO Creating table: permissions
[2017-09-26 22:20:35] INFO Creating table: permissions_users
[2017-09-26 22:20:35] INFO Creating table: permissions_roles
[2017-09-26 22:20:35] INFO Creating table: permissions_apps
[2017-09-26 22:20:35] INFO Creating table: settings
[2017-09-26 22:20:35] INFO Creating table: tags
[2017-09-26 22:20:35] INFO Creating table: posts_tags
[2017-09-26 22:20:35] INFO Creating table: apps
[2017-09-26 22:20:35] INFO Creating table: app_settings
[2017-09-26 22:20:35] INFO Creating table: app_fields
[2017-09-26 22:20:35] INFO Creating table: clients
[2017-09-26 22:20:35] INFO Creating table: client_trusted_domains
[2017-09-26 22:20:35] INFO Creating table: accesstokens
[2017-09-26 22:20:35] INFO Creating table: refreshtokens
[2017-09-26 22:20:35] INFO Creating table: subscribers
[2017-09-26 22:20:35] INFO Creating table: invites
[2017-09-26 22:20:35] INFO Creating table: brute
[2017-09-26 22:20:35] INFO Model: Post
[2017-09-26 22:20:35] INFO Model: Tag
[2017-09-26 22:20:35] INFO Model: Client
[2017-09-26 22:20:35] INFO Model: Role
[2017-09-26 22:20:35] INFO Model: Permission
[2017-09-26 22:20:35] INFO Model: User
[2017-09-26 22:20:36] INFO Relation: Role to Permission
[2017-09-26 22:20:36] INFO Relation: Post to Tag
[2017-09-26 22:20:36] INFO Relation: User to Role
[2017-09-26 22:20:37] INFO Finished database migration!
[2017-09-26 22:20:41] INFO Ghost is running in production...
[2017-09-26 22:20:41] INFO Your blog is now available on http://localhost:2368/
[2017-09-26 22:20:41] INFO Ctrl+C to shut down
[2017-09-26 22:20:41] INFO Ghost boot 4.139s |
I don't understand how I could work with persistent date if I cannot create directories and so on (e.g. adding a theme or updating it).
Configuration:
Steps:
The text was updated successfully, but these errors were encountered: