Skip to content

Commit

Permalink
Improve devcontainer Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
xmatthias committed Apr 27, 2024
1 parent 19284e1 commit bc5ded4
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@ USER root
# Install dependencies
COPY requirements-dev.txt /freqtrade/

ARG USERNAME=ftuser

RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils dialog \
&& apt-get -y install --no-install-recommends git sudo vim build-essential \
&& apt-get -y install --no-install-recommends git sudo ssh vim build-essential \
&& apt-get clean \
&& mkdir -p /home/ftuser/.vscode-server /home/ftuser/.vscode-server-insiders /home/ftuser/commandhistory \
&& echo "export PROMPT_COMMAND='history -a'" >> /home/ftuser/.bashrc \
&& echo "export HISTFILE=~/commandhistory/.bash_history" >> /home/ftuser/.bashrc \
&& chown ftuser:ftuser -R /home/ftuser/.local/ \
&& chown ftuser: -R /home/ftuser/
&& mkdir -p /home/${USERNAME}/.vscode-server /home/${USERNAME}/.vscode-server-insiders /home/${USERNAME}/commandhistory \
# Add user to Suders
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME \
# keep command history
&& echo "export PROMPT_COMMAND='history -a'" >> /home/${USERNAME}/.bashrc \
&& echo "export HISTFILE=~/commandhistory/.bash_history" >> /home/${USERNAME}/.bashrc \
&& chown ${USERNAME}:${USERNAME} -R /home/${USERNAME}/.local/ \
&& chown ${USERNAME}: -R /home/${USERNAME}/

USER ftuser

Expand Down

0 comments on commit bc5ded4

Please sign in to comment.