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

Allow the user to be set via an environment variable. #136

Closed
wants to merge 1 commit into from

Conversation

jaysh
Copy link

@jaysh jaysh commented Feb 14, 2015

Hi,

In #133 I suggested that it would be useful to allow the user to control both the user via an environmental variable. This PR contains the solution that works for my use case, and I'm hoping we can build on it to reach something that can be merged into the project :)

I needed a way of mounting a volume (either from the host, or a data container) for persistent storage within the app, but keeping the permissions reasonably simple (in terms of understanding). My main issue was that over the course of subsequent deploys, the container that originally wrote files to the persistent storage area was no longer able to manipulate them. It also made it difficult to share files with non-Dokku containers. I also wanted to avoid having to continuously re-chown'ing the files as the user changed.

This PR can be used in conjunction with the persistent storage plugin (https://github.com/dyson/dokku-persistent-storage) in order to populate the variables at build time, e.g.:

$ dokku docker-options example
-e USER_ID=1234
-e USER_NAME=example

Thanks,
Jay

@progrium
Copy link
Owner

I think I'm going to not accept this and focus on getting the herokuish
branch merged because it allows you to do this.

On Sat, Feb 14, 2015 at 4:14 PM, Jay Shah [email protected] wrote:

Hi,

In #133 #133 I suggested
that it would be useful to allow the user to control both the user via an
environmental variable. This PR contains the solution that works for my use
case, and I'm hoping we can build on it to reach something that can be
merged into the project :)

I needed a way of mounting a volume (either from the host, or a data
container) for persistent storage within the app, but keeping the
permissions reasonably simple (in terms of understanding). My main issue
was that over the course of subsequent deploys, the container that
originally wrote files to the persistent storage area was no longer able to
manipulate them. It also made it difficult to share files with non-Dokku
containers. I also wanted to avoid having to continuously re-chown'ing
the files as the user changed.

This PR can be used in conjunction with the persistent storage plugin (
https://github.com/dyson/dokku-persistent-storage) in order to populate
the variables at build time, e.g.:

$ dokku docker-options example
-e USER_ID=1234
-e USER_NAME=example

Thanks,

Jay

You can view, comment on, or merge this pull request online at:

#136
Commit Summary

  • Allow the UID and name to be set via an environment variable.

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#136.

Jeff Lindsay
http://progrium.com

@jaysh
Copy link
Author

jaysh commented Feb 16, 2015

Sounds good to me. Do let me know if there's anything I can do to assist you with that.

I'll close this PR for now.

@jaysh jaysh closed this Feb 16, 2015
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 this pull request may close these issues.

2 participants