I2P -> .NET

This commit is contained in:
Михаил Подивилов 2019-05-11 18:25:50 +03:00
parent f176f1909b
commit fdb0ce6703
272 changed files with 5702 additions and 8931 deletions

View file

@ -6,18 +6,18 @@ ARG GIT_BRANCH="openssl"
ENV GIT_BRANCH=${GIT_BRANCH}
ARG GIT_TAG=""
ENV GIT_TAG=${GIT_TAG}
ARG REPO_URL="https://github.com/PurpleI2P/i2pd.git"
ARG REPO_URL="https://github.com/PurpleI2P/dotnet.git"
ENV REPO_URL=${REPO_URL}
ENV I2PD_HOME="/home/i2pd"
ENV DATA_DIR="${I2PD_HOME}/data"
ENV DOTNET_HOME="/home/dotnet"
ENV DATA_DIR="${DOTNET_HOME}/data"
RUN mkdir -p "$I2PD_HOME" "$DATA_DIR" \
&& adduser -S -h "$I2PD_HOME" i2pd \
&& chown -R i2pd:nobody "$I2PD_HOME"
RUN mkdir -p "$DOTNET_HOME" "$DATA_DIR" \
&& adduser -S -h "$DOTNET_HOME" dotnet \
&& chown -R dotnet:nobody "$DOTNET_HOME"
#
# Each RUN is a layer, adding the dependencies and building i2pd in one layer takes around 8-900Mb, so to keep the
# Each RUN is a layer, adding the dependencies and building dotnet in one layer takes around 8-900Mb, so to keep the
# image under 20mb we need to remove all the build dependencies in the same "RUN" / layer.
#
@ -27,20 +27,20 @@ RUN mkdir -p "$I2PD_HOME" "$DATA_DIR" \
RUN apk --no-cache --virtual build-dependendencies add make gcc g++ libtool zlib-dev boost-dev build-base openssl-dev openssl git \
&& mkdir -p /tmp/build \
&& cd /tmp/build && git clone -b ${GIT_BRANCH} ${REPO_URL} \
&& cd i2pd \
&& cd dotnet \
&& if [ -n "${GIT_TAG}" ]; then git checkout tags/${GIT_TAG}; fi \
&& make \
&& cp -R contrib/certificates /i2pd_certificates \
&& cp -R contrib/certificates /dotnet_certificates \
&& mkdir -p /usr/local/bin \
&& mv i2pd /usr/local/bin \
&& mv dotnet /usr/local/bin \
&& cd /usr/local/bin \
&& strip i2pd \
&& strip dotnet \
&& rm -fr /tmp/build && apk --no-cache --purge del build-dependendencies build-base fortify-headers boost-dev zlib-dev openssl-dev \
boost-python3 python3 gdbm boost-unit_test_framework boost-python linux-headers boost-prg_exec_monitor \
boost-serialization boost-signals boost-wave boost-wserialization boost-math boost-graph boost-regex git pcre \
libtool g++ gcc pkgconfig
# 2. Adding required libraries to run i2pd to ensure it will run.
# 2. Adding required libraries to run dotnet to ensure it will run.
RUN apk --no-cache add boost-filesystem boost-system boost-program_options boost-date_time boost-thread boost-iostreams openssl musl-utils libstdc++
COPY entrypoint.sh /entrypoint.sh
@ -49,6 +49,6 @@ RUN chmod a+x /entrypoint.sh
RUN echo "export DATA_DIR=${DATA_DIR}" >> /etc/profile
VOLUME "$DATA_DIR"
EXPOSE 7070 4444 4447 7656 2827 7654 7650
USER i2pd
USER dotnet
ENTRYPOINT [ "/entrypoint.sh" ]