-
Notifications
You must be signed in to change notification settings - Fork 889
A new workspace from docker template does not source .bashrc
#10209
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
Could you share more about the setup? |
Yes. If I do |
Bash runs as a login shell by default, which means you need to have a |
As per internal discussion, we can fix this by populating a new workspace |
.bashrc
.bashrc
We are making heavely use of scripts in our template and has to source each and everywhere the .bashrc or adding ~/bin to the path again as this wont work out of the box. It would be nice to get rid of this. |
@MrPeacockNLB I'd like to understand in better detail what the issue you're facing is, could you share a bit more about what you're trying to do and how you're currently achieving it? Typically Alternatively, you could utilize the shebang ( Here's an example of me forcing the script to run in interactive mode (!!) and explicitly stating which rcfile to use: resource "coder_script" "bash_test" {
agent_id = coder_agent.main.id
display_name = "Bash Test Script"
run_on_start = true
script = <<-EOS
#!/usr/bin/env bash --rcfile ~/bashrc -i
echo hello world: $ENV_FROM_BASHRC
EOS
} (!!) Be careful with using interactive mode as this may allow programs to prompt for input and block execution, however Alternatively, you can use PS. The shebang works for shells, but it's not fully featured until #10194 is merged. |
@MrPeacockNLB alternatively, you can take a look at #12913 for how I'd solve this specific issue (#10209). |
A new workspace created from the docker template does not source
.bashrc
This prevents setting env variables or paths defined in
.bashrc
Coder version : v2.2.1-devel+fafecbd9b
The text was updated successfully, but these errors were encountered: