From 55ddbd409709d3ffb162faa8ec3f092da919ac9e Mon Sep 17 00:00:00 2001 From: Leopere Date: Tue, 2 Oct 2018 18:05:03 -0400 Subject: [PATCH] A few issues fixed with permissions Fixed who runs the mkdir commands in Dockerfile Added make double check for directories existence in start.sh Still doesn't necessarily fix invocation. Corrected user shell to not include trailing slash --- lbrycrd/Dockerfile | 8 +++++--- lbrycrd/start.sh | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lbrycrd/Dockerfile b/lbrycrd/Dockerfile index f96100c..89b359d 100644 --- a/lbrycrd/Dockerfile +++ b/lbrycrd/Dockerfile @@ -3,13 +3,12 @@ FROM ubuntu:18.04 MAINTAINER chamunks [at] gmail [dot] com -RUN adduser lbrycrdd --gecos GECOS --shell /bin/bash/ --disabled-password --home /data/ && \ +RUN adduser lbrycrdd --gecos GECOS --shell /bin/bash --disabled-password --home /data/ && \ apt-get update && \ apt-get -y install unzip wget && \ apt-get autoclean -y && \ rm -rf /var/lib/apt/lists/* - RUN wget -O /usr/bin/lbrycrd-linux.zip https://github.com/lbryio/lbrycrd/releases/download/v0.12.2.2/lbrycrd-linux.zip && \ cd /usr/bin/ && \ unzip lbrycrd-linux.zip && \ @@ -21,6 +20,9 @@ ADD docker-entrypoint.sh /usr/local/bin/docker-entrypoint USER lbrycrdd +RUN mkdir -p /data/lbrycrdd && \ + mkdir -p /etc/lbrycrdd + VOLUME /data/ VOLUME /etc/lbrycrdd/ @@ -28,6 +30,6 @@ VOLUME /etc/lbrycrdd/ EXPOSE 9245 9246 ## For now this is a placeholder that executes /bin/bash on `docker exec` -ENTRYPOINT ["docker-entrypoint"] +# ENTRYPOINT ["docker-entrypoint"] CMD ["start"] diff --git a/lbrycrd/start.sh b/lbrycrd/start.sh index 8a4a928..276c4cb 100755 --- a/lbrycrd/start.sh +++ b/lbrycrd/start.sh @@ -1,5 +1,8 @@ #!/bin/bash + ## Ensure perms are correct prior to running main binary +mkdir -p /data/lbrycrdd +mkdir -p /etc/lbrycrdd chown -R 1000:1000 /data chmod -R 755 /data chown -R 1000:1000 /etc/lbrycrdd