2018-12-03 02:14:33 +13:00
|
|
|
FROM debian:stretch-slim
|
2018-11-30 04:49:02 +13:00
|
|
|
|
|
|
|
ARG HOST_USER_ID=1000
|
|
|
|
ARG HOST_GROUP_ID=1000
|
|
|
|
|
|
|
|
ENV HOST_USER_ID=$HOST_USER_ID
|
|
|
|
ENV HOST_GROUP_ID=$HOST_GROUP_ID
|
|
|
|
|
|
|
|
RUN \
|
|
|
|
if [ $(getent group ${HOST_GROUP_ID}) ]; then \
|
|
|
|
useradd -r -u ${HOST_USER_ID} hydrus; \
|
|
|
|
else \
|
|
|
|
groupadd -g ${HOST_GROUP_ID} hydrus && \
|
|
|
|
useradd -r -u ${HOST_USER_ID} -g hydrus hydrus; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
2018-12-03 02:14:33 +13:00
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y ca-certificates curl ffmpeg wget --no-install-recommends && \
|
|
|
|
rm -rf /var/lib/apt/lists/* && \
|
|
|
|
wget "https://www.github.com$( \
|
2018-11-30 04:49:02 +13:00
|
|
|
curl -sL https://github.com/hydrusnetwork/hydrus/releases/latest \
|
|
|
|
| grep 'Linux.-.Executable.tar.gz' \
|
2018-12-03 02:14:33 +13:00
|
|
|
| sed -n 's/.*href="\([^"]*\).*/\1/p')" && \
|
|
|
|
tar zxvf $(ls | grep "Linux.-.Executable.tar.gz") --strip-components 1 && \
|
|
|
|
rm $(ls | grep "Linux.-.Executable.tar.gz") && \
|
|
|
|
chown -R hydrus:hydrus /usr/src/app && \
|
|
|
|
mkdir /data && chown -R hydrus:hydrus /data && \
|
2018-12-06 11:57:50 +13:00
|
|
|
apt-get remove ca-certificates curl wget -y && \
|
|
|
|
apt-get autoremove -y
|
2018-11-30 04:49:02 +13:00
|
|
|
|
|
|
|
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint
|
|
|
|
RUN chmod +x /usr/local/bin/docker-entrypoint
|
|
|
|
|
|
|
|
EXPOSE 45870/tcp
|
|
|
|
EXPOSE 45871/tcp
|
|
|
|
EXPOSE 45872/tcp
|
|
|
|
|
|
|
|
USER hydrus
|
|
|
|
|
|
|
|
ENTRYPOINT ["docker-entrypoint"]
|