-
Notifications
You must be signed in to change notification settings - Fork 15
/
Dockerfile.dsw-windows-x64-wallet
116 lines (96 loc) · 4.48 KB
/
Dockerfile.dsw-windows-x64-wallet
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#FROM decenomy/dsw-windows-x64-builder:latest
FROM decenomy/dsw-windows-x64-builder@sha256:c5102edf92fba810de6596cc9593729b79ab00ca8d88656d4613a3cfa1fecf78
# ARG for specifying the number of cores
ARG CPU_CORES=1
# ARG for specifying the coin parameters
ARG TICKER=BIR
ARG NAME=Birake
ARG BASE_NAME=birake
ARG TARGET=master
# Clone the repository
RUN if [ ! -d $TICKER ]; then \
git clone https://github.com/decenomy/$TICKER; \
fi
# Switch to the repository directory
WORKDIR /$TICKER
# Check out a specific version if needed
RUN git checkout -B $TARGET
RUN git pull origin $TARGET
RUN git log -1 --format="%at" | xargs -I{} date -d @{} "+%Y-%m-%d %H:%M:%S" > /git_timestamp
RUN git log -1 --format="%at" | xargs -I{} date -d @{} "+%Y%m%d%H%M.%S" > /git_timestamp_touch
# Run the configuration script
RUN PATH=${WRAP_DIR}:${PATH} ./autogen.sh && \
PATH=${WRAP_DIR}:${PATH} ./configure \
--prefix=/DSW/depends/x86_64-w64-mingw32 \
--disable-debug \
--disable-bench \
--disable-tests \
--disable-man \
--enable-zmq \
--with-gui \
--enable-upnp-default \
--enable-reduce-exports \
--disable-gui-tests \
CFLAGS="-O3" \
CXXFLAGS="-O3"
# Compile the binaries
RUN PATH=${WRAP_DIR}:${PATH} make -j$CPU_CORES HOST=x86_64-w64-mingw32
# Extract the wallet version
RUN grep "define(_CLIENT_VERSION_MAJOR" configure.ac | awk -F"[ ,)]" '{print $3}' | tr -d '\n' > /wallet_version
RUN echo -n "." >> /wallet_version
RUN grep "define(_CLIENT_VERSION_MINOR" configure.ac | awk -F"[ ,)]" '{print $3}' | tr -d '\n' >> /wallet_version
RUN echo -n "." >> /wallet_version
RUN grep "define(_CLIENT_VERSION_REVISION" configure.ac | awk -F"[ ,)]" '{print $3}' | tr -d '\n' >> /wallet_version
RUN echo -n "." >> /wallet_version
RUN grep "define(_CLIENT_VERSION_BUILD" configure.ac | awk -F"[ ,)]" '{print $3}' | tr -d '\n' >> /wallet_version
# Create deploy files
RUN mkdir -p deploy/windows-x64
RUN PATH=${WRAP_DIR}:${PATH} x86_64-w64-mingw32-strip -s \
src/$(echo $BASE_NAME)d.exe \
src/$(echo $BASE_NAME)-cli.exe \
src/$(echo $BASE_NAME)-tx.exe \
src/qt/$(echo $BASE_NAME)-qt.exe
RUN cp \
src/$(echo $BASE_NAME)d.exe \
src/$(echo $BASE_NAME)-cli.exe \
src/$(echo $BASE_NAME)-tx.exe \
src/qt/$(echo $BASE_NAME)-qt.exe \
/$TICKER/deploy/windows-x64
RUN find /$TICKER/deploy/windows-x64 -type f -exec touch -t $(cat /git_timestamp_touch) {} +
WORKDIR /$TICKER/deploy/windows-x64
RUN PATH=${WRAP_DIR}:${PATH} zip -X $TICKER-$(cat /wallet_version)-Windows-x64.zip \
$(echo $BASE_NAME)d.exe \
$(echo $BASE_NAME)-cli.exe \
$(echo $BASE_NAME)-tx.exe \
$(echo $BASE_NAME)-qt.exe
RUN sha256sum $(echo $BASE_NAME)d.exe >> SHA256SUMS-Windows-x64.ASC
RUN sha256sum $(echo $BASE_NAME)-cli.exe >> SHA256SUMS-Windows-x64.ASC
RUN sha256sum $(echo $BASE_NAME)-tx.exe >> SHA256SUMS-Windows-x64.ASC
RUN sha256sum $(echo $BASE_NAME)-qt.exe >> SHA256SUMS-Windows-x64.ASC
RUN sha256sum $TICKER-$(cat /wallet_version)-Windows-x64.zip >> SHA256SUMS-Windows-x64.ASC
# Set the Inno Setup compiler
RUN mkdir -p /$TICKER/contrib/innosetup/package
RUN cp $(echo $BASE_NAME)* /$TICKER/contrib/innosetup/package/
RUN find /$TICKER/contrib/innosetup/ -type f -exec touch -t $(cat /git_timestamp_touch) {} +
RUN find /$TICKER/contrib/innosetup/package/ -type f -exec touch -t $(cat /git_timestamp_touch) {} +
WORKDIR /$TICKER/contrib/innosetup
RUN PATH=${WRAP_DIR}:${PATH} wine ~/.wine/drive_c/Program\ Files\ \(x86\)/Inno\ Setup\ 6/ISCC.exe setup.iss
RUN mv output/$(echo $NAME)Setup.exe /$TICKER/deploy/windows-x64/$(echo $NAME)-$(cat /wallet_version)-Setup.exe
WORKDIR /$TICKER/deploy/windows-x64
RUN touch -t $(cat /git_timestamp_touch) $(echo $NAME)-$(cat /wallet_version)-Setup.exe
RUN PATH=${WRAP_DIR}:${PATH} zip -X $TICKER-$(cat /wallet_version)-WindowsSetup-x64.zip \
$(echo $NAME)-$(cat /wallet_version)-Setup.exe
RUN sha256sum $(echo $NAME)-$(cat /wallet_version)-Setup.exe >> SHA256SUMS-Windows-x64.ASC
RUN sha256sum $TICKER-$(cat /wallet_version)-WindowsSetup-x64.zip >> SHA256SUMS-Windows-x64.ASC
# To compile and build the container execute docker in this way:
# docker build \
# --build-arg CPU_CORES=<num_cores> \
# --build-arg TICKER=> \
# --build-arg NAME=<coin_name> \
# --build-arg BASE_NAME=<base_name> \
# --build-arg TARGET=<branch|commit|tag> \
# -f Dockerfile.dsw-windows-x64-wallet .
# To run the container use:
# docker run -it <image_id>
# Set the entry point if you want to interact within the container
ENTRYPOINT ["bash"]