-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
178 lines (139 loc) · 4.05 KB
/
Dockerfile
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
FROM ubuntu:16.04 AS ubuntu-base
FROM ubuntu-base AS build-headless
LABEL maintainer="Sven Skender (@sskender)"
# Install dependencies
RUN apt-get update -y
RUN apt-get install \
apt-utils \
pkg-config \
-y
RUN apt-get install \
automake \
bsdmainutils \
cmake \
curl \
libtool \
make \
python3 \
wget \
-y
RUN apt-get install \
libboost-all-dev \
libminiupnpc-dev \
libqrencode-dev \
libssl-dev \
libzmq-dev \
-y
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Build berkeleydb v5.3
WORKDIR /build
ENV BERKELEYDB_VERSION=db-5.3.28
RUN wget "http://download.oracle.com/berkeley-db/${BERKELEYDB_VERSION}.tar.gz"
RUN tar -xvzf ${BERKELEYDB_VERSION}.tar.gz
WORKDIR /build/${BERKELEYDB_VERSION}/build_unix
RUN ../dist/configure --with-static --enable-cxx --disable-shared --with-pic --prefix=/usr/local && \
make -j$(nproc) && \
make install
WORKDIR /build
RUN rm ${BERKELEYDB_VERSION}.tar.gz
RUN rm -r ${BERKELEYDB_VERSION}
FROM ubuntu-base AS build-mxe
LABEL maintainer="Sven Skender (@sskender)"
# Install mxe
RUN apt-get update -y
RUN apt-get install \
autoconf \
automake \
autopoint \
bash \
bison \
bzip2 \
flex \
g++ \
g++-multilib \
gettext \
git \
gperf \
intltool \
libc6-dev-i386 \
libgdk-pixbuf2.0-dev \
libltdl-dev \
libssl-dev \
libtool-bin \
libxml-parser-perl \
lzip \
make \
openssl \
p7zip-full \
patch \
perl \
python \
python3 \
ruby \
sed \
unzip \
wget \
xz-utils \
g++-multilib \
libc6-dev-i386 \
-y
WORKDIR /build
ENV MXE_BRANCH_TAG=build-2022-01-13
RUN git clone --depth 1 --branch $MXE_BRANCH_TAG https://github.com/mxe/mxe.git
# Build base mxe tools
WORKDIR /build/mxe
RUN make MXE_TARGETS="i686-w64-mingw32.static" gcc
RUN make MXE_TARGETS="i686-w64-mingw32.static" zlib
RUN make MXE_TARGETS="i686-w64-mingw32.static" libpng
RUN make MXE_TARGETS="i686-w64-mingw32.static" openssl
RUN make MXE_TARGETS="i686-w64-mingw32.static" boost
RUN make MXE_TARGETS="i686-w64-mingw32.static" libqrencode
RUN make MXE_TARGETS="i686-w64-mingw32.static" qtbase
RUN make MXE_TARGETS="i686-w64-mingw32.static" qttools
RUN make MXE_TARGETS="i686-w64-mingw32.static" qttranslations
# Build openssl v1.0
RUN make MXE_TARGETS="i686-w64-mingw32.static" openssl1.0 MXE_PLUGIN_DIRS=plugins/examples/openssl1.0/
# Build berkeleydb v5.3
WORKDIR /build
RUN wget http://download.oracle.com/berkeley-db/db-5.3.28.tar.gz
RUN tar -xzf db-5.3.28.tar.gz
WORKDIR /build/db-5.3.28
ENV MXE_PATH=/build/mxe
RUN sed -i "s/WinIoCtl.h/winioctl.h/g" src/dbinc/win_db.h
WORKDIR /build/db-5.3.28/build_mxe
RUN CC=$MXE_PATH/usr/bin/i686-w64-mingw32.static-gcc \
CXX=$MXE_PATH/usr/bin/i686-w64-mingw32.static-g++ \
../dist/configure \
--disable-replication \
--enable-mingw \
--enable-cxx \
--host x86 \
--prefix=$MXE_PATH/usr/i686-w64-mingw32.static && \
make && \
make install
WORKDIR /build
RUN rm db-5.3.28.tar.gz
RUN rm -r db-5.3.28
# Build miniupnp v1.6
WORKDIR /build
RUN wget http://miniupnp.free.fr/files/miniupnpc-1.6.20120509.tar.gz
RUN tar -xzf miniupnpc-1.6.20120509.tar.gz
WORKDIR /build/miniupnpc-1.6.20120509
ENV MXE_PATH=/build/mxe
RUN CC=$MXE_PATH/usr/bin/i686-w64-mingw32.static-gcc \
AR=$MXE_PATH/usr/bin/i686-w64-mingw32.static-ar \
CFLAGS="-DSTATICLIB -I$MXE_PATH/usr/i686-w64-mingw32.static/include" \
LDFLAGS="-L$MXE_PATH/usr/i686-w64-mingw32.static/lib" \
make libminiupnpc.a
RUN mkdir -p $MXE_PATH/usr/i686-w64-mingw32.static/include/miniupnpc
RUN cp -f *.h $MXE_PATH/usr/i686-w64-mingw32.static/include/miniupnpc
RUN cp -f libminiupnpc.a $MXE_PATH/usr/i686-w64-mingw32.static/lib
WORKDIR /build
RUN rm miniupnpc-1.6.20120509.tar.gz
RUN rm -r miniupnpc-1.6.20120509
# Set MXE environment variables
ENV MXE_PATH=/build/mxe
ENV PATH=/build/mxe/usr/bin:$PATH
ENV MXE_INCLUDE_PATH=/build/mxe/usr/i686-w64-mingw32.static/include
ENV MXE_LIB_PATH=/build/mxe/usr/i686-w64-mingw32.static/lib