From 2d702e96470781be75c664844d412a5253c970d0 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Wed, 6 Feb 2019 17:19:09 +0200 Subject: [PATCH] Create user "bitmessage" to setup and run bitmessaged --- Dockerfile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4cb7e1c1..918f737d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,14 +29,19 @@ RUN python2 setup.py sdist \ && py2dsc-deb dist/pybitmessage-${VER}.tar.gz \ && dpkg -i deb_dist/python-pybitmessage_${VER}-1_amd64.deb +# Create a user +RUN useradd bitmessage && chown -R bitmessage ${HOME} + +USER bitmessage + # Generate default config -RUN src/bitmessagemain.py -t && mv keys.dat .. +RUN src/bitmessagemain.py -t && mv keys.dat /tmp # Clean HOME -RUN rm -rf ${HOME} +RUN rm -rf ${HOME}/* # Setup environment -RUN mv ../keys.dat . \ +RUN mv /tmp/keys.dat . \ && APIPASS=$(tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo) \ && echo "\napiusername: api\napipassword: $APIPASS" \ && echo "apienabled = true\napiinterface = 0.0.0.0\napiusername = api\napipassword = $APIPASS" >> keys.dat