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
This commit is contained in:
Leopere 2018-10-02 18:05:03 -04:00
parent cc76cbec0e
commit 55ddbd4097
2 changed files with 8 additions and 3 deletions

View file

@ -3,13 +3,12 @@
FROM ubuntu:18.04 FROM ubuntu:18.04
MAINTAINER chamunks [at] gmail [dot] com 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 update && \
apt-get -y install unzip wget && \ apt-get -y install unzip wget && \
apt-get autoclean -y && \ apt-get autoclean -y && \
rm -rf /var/lib/apt/lists/* 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 && \ 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/ && \ cd /usr/bin/ && \
unzip lbrycrd-linux.zip && \ unzip lbrycrd-linux.zip && \
@ -21,6 +20,9 @@ ADD docker-entrypoint.sh /usr/local/bin/docker-entrypoint
USER lbrycrdd USER lbrycrdd
RUN mkdir -p /data/lbrycrdd && \
mkdir -p /etc/lbrycrdd
VOLUME /data/ VOLUME /data/
VOLUME /etc/lbrycrdd/ VOLUME /etc/lbrycrdd/
@ -28,6 +30,6 @@ VOLUME /etc/lbrycrdd/
EXPOSE 9245 9246 EXPOSE 9245 9246
## For now this is a placeholder that executes /bin/bash on `docker exec` ## For now this is a placeholder that executes /bin/bash on `docker exec`
ENTRYPOINT ["docker-entrypoint"] # ENTRYPOINT ["docker-entrypoint"]
CMD ["start"] CMD ["start"]

View file

@ -1,5 +1,8 @@
#!/bin/bash #!/bin/bash
## Ensure perms are correct prior to running main binary ## Ensure perms are correct prior to running main binary
mkdir -p /data/lbrycrdd
mkdir -p /etc/lbrycrdd
chown -R 1000:1000 /data chown -R 1000:1000 /data
chmod -R 755 /data chmod -R 755 /data
chown -R 1000:1000 /etc/lbrycrdd chown -R 1000:1000 /etc/lbrycrdd