forked from blocknetdx/blocknet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-win
61 lines (51 loc) · 2.13 KB
/
Dockerfile-win
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
FROM ubuntu:bionic
ARG cores=8
ENV ecores=$cores
RUN apt update \
&& apt install -y --no-install-recommends \
software-properties-common \
ca-certificates \
wget curl git python vim \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN add-apt-repository ppa:bitcoin/bitcoin \
&& apt update \
&& apt install -y --no-install-recommends \
build-essential libtool autotools-dev bsdmainutils \
libevent-dev autoconf automake pkg-config libssl-dev \
libdb4.8-dev libdb4.8++-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# mingw
RUN apt update \
&& apt install -y --no-install-recommends \
g++-mingw-w64-x86-64 nsis zip \
&& update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENV PROJECTDIR=/opt/blocknetdx/blocknet
ENV BASEPREFIX=$PROJECTDIR/depends
ENV DISTDIR=/opt/blocknetdx/dist
ENV HOST=x86_64-w64-mingw32
# Download depends
RUN mkdir -p $PROJECTDIR \
&& cd $PROJECTDIR \
&& wget -nv https://s3.us-east-2.amazonaws.com/devbuilds.blocknetprotocol.com/depends/depends-v4.2.0-win-bionic.tar.gz \
&& [ "$(printf '1a10012c4fd13cc1eb671ac5a3919cd42c86b9ff90f875ce8fa153a77871170c depends-v4.2.0-win-bionic.tar.gz' | sha256sum -c)" = "depends-v4.2.0-win-bionic.tar.gz: OK" ] || $(echo "depends checksum failed"; exit 1)
# Copy source files
COPY . $PROJECTDIR/
# Build source
RUN mkdir -p $DISTDIR \
&& cd $PROJECTDIR \
&& rm -r $BASEPREFIX \
&& tar xzvf depends-v4.2.0-win-bionic.tar.gz \
&& chmod +x ./autogen.sh; sync \
&& ./autogen.sh \
&& CONFIG_SITE=$BASEPREFIX/$HOST/share/config.site ./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking --enable-reduce-exports --disable-bench --disable-gui-tests \
&& make clean \
&& echo "Building with cores: $ecores" \
&& make -j$ecores \
&& make deploy \
&& make install DESTDIR=$DISTDIR \
&& cp *win64-setup.exe $DISTDIR/bin/blocknet-win64-setup.exe \
&& make clean
WORKDIR /opt/blocknetdx/dist
# Port, RPC, Test Port, Test RPC
EXPOSE 41412 41414 41474 41419