Only allow chown via sudo

This commit is contained in:
Matthias 2021-04-08 20:36:10 +02:00
parent 4eb251ce41
commit 644dcc1641
3 changed files with 10 additions and 7 deletions

View File

@ -16,7 +16,7 @@ RUN mkdir /freqtrade \
&& useradd -u 1000 -G sudo -U -m ftuser \
&& chown ftuser:ftuser /freqtrade \
# Allow sudoers
&& echo "ftuser ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
&& echo "ftuser ALL=(ALL) NOPASSWD: /bin/chown" >> /etc/sudoers
WORKDIR /freqtrade

View File

@ -16,7 +16,7 @@ RUN mkdir /freqtrade \
&& useradd -u 1000 -G sudo -U -m ftuser \
&& chown ftuser:ftuser /freqtrade \
# Allow sudoers
&& echo "ftuser ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
&& echo "ftuser ALL=(ALL) NOPASSWD: /bin/chown" >> /etc/sudoers
WORKDIR /freqtrade

View File

@ -1,7 +1,10 @@
FROM freqtradeorg/freqtrade:develop
RUN sudo apt-get update \
&& sudo apt-get -y install git \
&& sudo apt-get clean \
# The below dependency - pyti - serves as an example. Please use whatever you need!
&& pip install --user pyti
# Switch user to root if you must install something from apt
# Don't forget to switch the user back below!
# USER root
# The below dependency - pyti - serves as an example. Please use whatever you need!
RUN pip install --user pyti
# USER ftuser