-
Notifications
You must be signed in to change notification settings - Fork 180
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
How to use environment variables XDG_CONFIG_HOME, etc. in rocker/rstudio ? #103
Comments
If I set the It seems that I need to load I tried to set up |
Hi @eitsupi, I reviewed the manual and with the background of your issue, you want to move the user specific I think your Issue is related to #170 and is better understandable when reading Section 5.2 of the RStudio Server Manual. The Problem is, that the community Edition of RStudio Server is not inheriting any bash env var from the context it launches from. So in the issue I linked, I am working on a pullrequest for solving this issue with dynamic ENV Vars on container startup. After the work is done, you would be able to set the ENV-Vars dynamically on container startup. In the meantime you can write the env vars to Hopefully that helps and kind regards. |
@eitsupi I believe we load env vars from I think it might work either to link a file to |
@cboettig Thank you. My need was to make the RStudio configuration file persistent. version: "3"
services:
rstudio:
image: rocker/rstudio
environment:
- PASSWORD=foobar
ports:
- "8787:8787"
volumes:
- ./.rstudio_config:/home/rstudio/.config/rstudio It is a little troublesome to add values to After some testing, I found that not all environment variables in @myoung3 Did the method of writing to |
@eitsupi Not quite. I was successfully able to write to binding is definitely working correctly (files created in the bound directory are visible in both the container and locally) and writing to /etc/environment in the image during build is definitely working, but rstudio doesn't seem to be detecting these environment variables.
This is the command I'm using to start rstudio server if it makes any difference:
|
wow I just found a much easier solution that doesn't involve writing to from within the singularity instance, I just need to run:
"s6-env prints the current environment or modifies the environment before running a program." |
Thanks @myoung3 , that's great. I still think we should probably modify the script so that we pick up any system env vars instead of adding to |
Yeah I'm not sure what the right way to modify the rocker source code to make it easier for rocker users to alter environmental variables of rserver, I was mostly documenting my solution to give people options if they stumble across this issue. With that said, the rstudio server docs do recommend using whatever init system is installed:
I don't really understand init systems, environmental variables, etc well enough to have a good sense of why this is their recommendation (as opposed to making it so |
According to the release notes, the new RStudio v1.4 adds new environment variables
XDG_CONFIG_HOME
to customize the location of the user data folder (default :/home/rstudio/.config/rstudio
) .https://docs.rstudio.com/ide/server-pro/server-management.html#configure-service
How can I set up these variables in rocker?
The text was updated successfully, but these errors were encountered: