Skip to content

[v2] Use bash by default in the Docker container #918

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

Closed
paolomainardi opened this issue Aug 18, 2019 · 10 comments
Closed

[v2] Use bash by default in the Docker container #918

paolomainardi opened this issue Aug 18, 2019 · 10 comments

Comments

@paolomainardi
Copy link
Contributor

Description

Terminal does not start with bash shell when opened for the first time.

Screenshot 2019-08-18 at 13 35 52

@deansheather
Copy link
Member

In my experience it just uses your login shell. Could you try chsh -s bash and see if that helps?

@cfi2017
Copy link

cfi2017 commented Aug 19, 2019

vscode also has a setting to override the default shell used. In our case, it was easier to do something like:

cat << EOF > /home/coder/.config/code-server/User/settings.json
{
    "terminal.integrated.shell.linux": "/bin/bash"
}
EOF

since we also needed to override other settings.

@code-asher
Copy link
Member

code-asher commented Aug 26, 2019 via email

@code-asher
Copy link
Member

Closing since I don't believe there is anything reasonable we can do here. If $SHELL isn't set sh is the safest fallback.

@code-asher
Copy link
Member

Reopening because in the Docker container at least we should be able to set the default shell to bash.

@code-asher code-asher reopened this Sep 18, 2019
@code-asher code-asher changed the title [v2] Terminal does not start with Bash shell [v2] Use bash by default in the Docker container Sep 18, 2019
@sr229
Copy link
Contributor

sr229 commented Sep 18, 2019

just slap this in and this will make it the default

ENV SHELL /bin/bash

@code-asher
Copy link
Member

I was thinking the same thing but then I wondered if we could pull it from the user. Normally I think login sets $SHELL based on /etc/passwd but maybe we can just read it ourselves when $SHELL isn't set. That would have the advantage of working in other situations as well.

@ishu-harsh
Copy link

It's Works - saved my time

@sorenwacker
Copy link

Hm, does not work for some strange reason.

`FROM ubuntu:focal

ENV PYTHONUNBUFFERED=1

ENV SHELL /bin/bash

RUN mkdir /data /compute /static /appmedia

RUN apt update && apt install -y build-essential wget

RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh &&
/bin/bash ~/miniconda.sh -b -p /opt/conda &&
rm ~/miniconda.sh &&
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh &&
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc &&
echo "conda activate base" >> ~/.bashrc

WORKDIR /app
COPY requirements.txt /app/
RUN conda install --file requirements.txt`

returns:

ERROR: Service 'web' failed to build: The command '/bin/sh -c conda install --file requirements.txt' returned a non-zero code: 127

@code-asher
Copy link
Member

@soerendip I believe 127 means command not found so you probably need to install conda.

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

No branches or pull requests

8 participants