-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
67 lines (59 loc) · 2.03 KB
/
Dockerfile
File metadata and controls
67 lines (59 loc) · 2.03 KB
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
FROM ubuntu
# multiarch/crossbuild
ARG ZLIB_VERSION=1.3.2
RUN apt-get update && \
export DEBIAN_FRONTEND=noninteractive && \
apt-get install -yq \
ca-certificates \
automake \
build-essential \
cmake \
curl \
file \
g++ \
git \
libtool \
linux-libc-dev \
musl-dev \
musl-tools \
pkgconf \
unzip \
xutils-dev \
libminizip-dev \
&& \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Static linking for C/C++ code using musl-libc
RUN ln -s "/usr/bin/g++" "/usr/bin/musl-g++"
ENV CC=musl-gcc C_INCLUDE_PATH=/usr/local/musl/include/
ENV PKG_CONFIG_PATH=/usr/local/musl/lib/pkgconfig
RUN echo "Building zlib" \
&& cd /tmp \
&& curl -k -fLO "https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz" \
&& tar xzf "zlib-${ZLIB_VERSION}.tar.gz" \
&& cd "zlib-${ZLIB_VERSION}" \
&& CC=musl-gcc ./configure --static --prefix=/usr/local/musl \
&& make -j$(nproc) \
&& make install
RUN echo "Building expat" \
&& cd /tmp \
&& curl -k -LO https://github.com/libexpat/libexpat/releases/download/R_2_2_10/expat-2.2.10.tar.gz \
&& tar -xvf expat-2.2.10.tar.gz \
&& cd expat-2.2.10 \
&& CFLAGS="-fPIC" ./configure --prefix=/usr/local/musl/ --enable-shared=no \
&& make \
&& make install \
&& rm -r /tmp/*
RUN mkdir -p /usr/local/musl/include/minizip \
&& cp -r /usr/include/minizip/* /usr/local/musl/include/minizip/
RUN echo "Building xlsxio" \
&& cd /tmp \
&& curl -k -fLO "https://github.com/brechtsanders/xlsxio/archive/refs/tags/0.2.33.tar.gz" \
&& tar xzf 0.2.33.tar.gz \
&& cd xlsxio-0.2.33 \
&& make static-lib \
CC=musl-gcc \
CFLAGS="-I/usr/local/musl/include" \
LDFLAGS="-L/usr/local/musl/lib" \
&& install -v -m755 libxlsxio_read.a /usr/local/musl/lib/ \
&& install -v -m755 libxlsxio_write.a /usr/local/musl/lib/ \
&& install -v -m755 include/* /usr/local/musl/include/