2022-04-04 00:24:06 +02:00
|
|
|
# syntax=docker/dockerfile:1.3
|
|
|
|
FROM ubuntu:focal
|
2021-03-24 11:11:50 +01:00
|
|
|
LABEL maintainer="Dash Developers <dev@dash.org>"
|
|
|
|
LABEL description="Dockerised DashCore"
|
|
|
|
|
|
|
|
ARG USER_ID
|
|
|
|
ARG GROUP_ID
|
2022-04-04 00:24:06 +02:00
|
|
|
ARG BRANCH
|
2021-03-24 11:11:50 +01:00
|
|
|
|
2022-08-22 21:42:36 +02:00
|
|
|
ENV HOME /home/dash
|
2021-03-24 11:11:50 +01:00
|
|
|
|
|
|
|
# add user with specified (or default) user/group ids
|
|
|
|
ENV USER_ID ${USER_ID:-1000}
|
|
|
|
ENV GROUP_ID ${GROUP_ID:-1000}
|
|
|
|
RUN groupadd -g ${GROUP_ID} dash && \
|
2022-08-22 21:42:36 +02:00
|
|
|
useradd -u ${USER_ID} -g dash -s /bin/bash -m -d /home/dash dash && \
|
|
|
|
mkdir /home/dash/.dashcore && \
|
|
|
|
chown ${USER_ID}:${GROUP_ID} -R /home/dash
|
2021-03-24 11:11:50 +01:00
|
|
|
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get -y install --no-install-recommends \
|
|
|
|
wget \
|
|
|
|
ca-certificates \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
2022-08-22 21:42:36 +02:00
|
|
|
COPY dashcore-binaries/${BRANCH}/dashcore* /home/dash
|
2022-04-04 00:24:06 +02:00
|
|
|
|
2021-03-24 11:11:50 +01:00
|
|
|
RUN mach=$(uname -m) \
|
2021-12-03 22:51:20 +01:00
|
|
|
&& case $mach in aarch64) arch="aarch64-linux-gnu"; ;; x86_64) arch="x86_64-linux-gnu"; ;; *) echo "ERROR: Machine type $mach not supported."; ;; esac \
|
2022-08-22 21:42:36 +02:00
|
|
|
&& cd /home/dash \
|
2022-04-04 00:24:06 +02:00
|
|
|
&& tar xvzf dashcore*$arch.tar.gz \
|
2022-08-22 21:42:36 +02:00
|
|
|
&& echo $(ls -1 /home/dash) \
|
2022-04-04 00:24:06 +02:00
|
|
|
&& cp dashcore-*/bin/* /usr/local/bin \
|
|
|
|
&& rm -rf dash*
|
2021-03-24 11:11:50 +01:00
|
|
|
|
|
|
|
USER dash
|
|
|
|
|
2022-08-22 21:42:36 +02:00
|
|
|
VOLUME ["/home/dash"]
|
2021-03-24 11:11:50 +01:00
|
|
|
|
2022-04-04 00:24:06 +02:00
|
|
|
COPY dash/contrib/containers/deploy/docker-entrypoint.sh /docker-entrypoint.sh
|
2021-06-02 19:54:57 +02:00
|
|
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
|
|
|
|
2021-03-24 11:11:50 +01:00
|
|
|
EXPOSE 9998 9999 19998 19999
|
|
|
|
|
2022-08-22 21:42:36 +02:00
|
|
|
WORKDIR /home/dash
|