dash/contrib/containers/deploy/Dockerfile.GitHubActions.Gitian
Kittywhiskers Van Gogh 6699b0228f
docker: fix gitian support, optimize container layer count and improve script consistency (#4983)
* contrib: set the working directory to /src/dash to allow for cloning gitian dependencies

* contrib: place the home directory inside /home instead of root

* contrib: add notes about sharing ccache across the network

* contrib: chown based on the (u/g)id env vars instead of the associated username

* contrib: reduce layer count by reducing run invocations

* contrib: develop container cleanup and maintenance

- add apt-cacher-ng, gpg, lsb-release, screen as a package dependencies
- reorder packages in alphabetical order
- correct documentation
- create and add user to the docker group to satisfy Gitian's needs
- reduce the number of RUN calls to reduce layer count
2022-08-22 22:42:36 +03:00

46 lines
1.2 KiB
Docker

# syntax=docker/dockerfile:1.3
FROM ubuntu:focal
LABEL maintainer="Dash Developers <dev@dash.org>"
LABEL description="Dockerised DashCore"
ARG USER_ID
ARG GROUP_ID
ARG BRANCH
ENV HOME /home/dash
# 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 && \
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
RUN apt-get update && \
apt-get -y install --no-install-recommends \
wget \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY dashcore-binaries/${BRANCH}/dashcore* /home/dash
RUN mach=$(uname -m) \
&& case $mach in aarch64) arch="aarch64-linux-gnu"; ;; x86_64) arch="x86_64-linux-gnu"; ;; *) echo "ERROR: Machine type $mach not supported."; ;; esac \
&& cd /home/dash \
&& tar xvzf dashcore*$arch.tar.gz \
&& echo $(ls -1 /home/dash) \
&& cp dashcore-*/bin/* /usr/local/bin \
&& rm -rf dash*
USER dash
VOLUME ["/home/dash"]
COPY dash/contrib/containers/deploy/docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
EXPOSE 9998 9999 19998 19999
WORKDIR /home/dash