2019-04-17 01:00:39 +02:00
|
|
|
FROM ubuntu:18.04 as prep
|
2018-10-16 09:30:13 +02:00
|
|
|
LABEL MAINTAINER="leopere [at] nixc [dot] us"
|
2019-04-17 01:00:39 +02:00
|
|
|
## TODO: Implement version pinning. `apt-get install curl=<version>`
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get -y install unzip curl build-essential && \
|
|
|
|
apt-get autoclean -y && \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /
|
|
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
2019-04-26 02:41:42 +02:00
|
|
|
COPY ./stuff/start.sh start
|
|
|
|
COPY ./stuff/healthcheck.sh healthcheck
|
|
|
|
COPY ./stuff/advance_blocks.sh advance
|
|
|
|
COPY ./stuff/fix-permissions.c fix-permissions.c
|
2019-10-10 02:48:46 +02:00
|
|
|
RUN curl --progress-bar -L -o ./lbrycrd-linux.zip $(curl -s https://api.github.com/repos/lbryio/lbrycrd/releases | grep -F 'lbrycrd-linux.zip' | grep download | head -n 1 | cut -d'"' -f4) && \
|
2019-04-17 01:00:39 +02:00
|
|
|
unzip ./lbrycrd-linux.zip && \
|
|
|
|
gcc fix-permissions.c -o fix-permissions && \
|
2019-04-24 05:34:33 +02:00
|
|
|
chmod +x ./lbrycrdd ./lbrycrd-cli ./lbrycrd-tx ./start ./healthcheck ./fix-permissions ./advance
|
2019-04-17 01:00:39 +02:00
|
|
|
|
|
|
|
FROM ubuntu:18.04 as app
|
2019-04-24 05:34:33 +02:00
|
|
|
COPY --from=prep /lbrycrdd /lbrycrd-cli /lbrycrd-tx /start /healthcheck /fix-permissions /advance /usr/bin/
|
2018-11-09 07:30:21 +01:00
|
|
|
RUN addgroup --gid 1000 lbrycrd && \
|
2019-04-17 01:00:39 +02:00
|
|
|
adduser lbrycrd --uid 1000 --gid 1000 --gecos GECOS --shell /bin/bash --disabled-password --home /data && \
|
2019-04-27 23:22:12 +02:00
|
|
|
mkdir /etc/lbry && \
|
|
|
|
chown lbrycrd /etc/lbry && \
|
2019-04-17 01:00:39 +02:00
|
|
|
chmod a+s /usr/bin/fix-permissions
|
2018-11-09 07:30:21 +01:00
|
|
|
VOLUME ["/data"]
|
|
|
|
WORKDIR /data
|
2019-10-05 00:38:44 +02:00
|
|
|
HEALTHCHECK CMD /usr/bin/healthcheck
|
2019-07-11 15:57:32 +02:00
|
|
|
EXPOSE 9246 9245 11337 29245
|
2018-11-07 01:39:12 +01:00
|
|
|
|
2019-04-17 01:00:39 +02:00
|
|
|
USER lbrycrd
|
2018-10-02 22:38:34 +02:00
|
|
|
CMD ["start"]
|