Skip to content

Commit 1bfd672

Browse files
committed
Cleanups
1 parent 11c6481 commit 1bfd672

1 file changed

Lines changed: 23 additions & 3 deletions

File tree

Dockerfile.squashfs-tools

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,36 @@
11
FROM alpine:latest AS build
2-
ARG SQUASHFS_TOOLS_VERSION=4.6.1
2+
# We would be fine using 4.7 (latest) except for needing
3+
# https://github.com/plougher/squashfs-tools/pull/314
4+
# for Alpine builds to work
5+
ARG SQUASHFS_TOOLS_VERSION=65362f488c8859db6612a1ed3630c7352fff2a7e
36
WORKDIR /usr/src
47

58
# build dependencies
6-
RUN apk update && apk add build-base git zlib-dev zlib-static zstd-dev zstd-static lz4-dev lz4-static
9+
RUN apk update && apk add build-base cmake git sed
10+
# build zlib-ng in static lib/"zlib-compat" mode (alpine doesn't have a static/dev variant yet)
11+
ENV ZLIB_NG_VERSION=2.2.4
12+
RUN git clone https://github.com/zlib-ng/zlib-ng.git && cd zlib-ng && git checkout $ZLIB_NG_VERSION
13+
WORKDIR /usr/src/zlib-ng
14+
RUN cmake . -DZLIB_COMPAT=1
15+
RUN cmake --build . --config Release
16+
RUN cmake --build . --target install
717

818
# check out squashfs-tools sources
19+
WORKDIR /usr/src
920
ENV SQUASHFS_TOOLS_VERSION=${SQUASHFS_TOOLS_VERSION}
10-
RUN git clone https://github.com/plougher/squashfs-tools && cd squashfs-tools && git checkout squashfs-tools-$SQUASHFS_TOOLS_VERSION
21+
RUN git clone https://github.com/plougher/squashfs-tools && cd squashfs-tools && git checkout $SQUASHFS_TOOLS_VERSION
1122
WORKDIR /usr/src/squashfs-tools/squashfs-tools
23+
# We don't use most of these libs, so turn them off.
24+
RUN sed -i \
25+
-e 's/LZO_SUPPORT = 1/LZO_SUPPORT = 0/' \
26+
-e 's/XZ_SUPPORT = 1/XZ_SUPPORT = 0/' \
27+
-e 's/ZSTD_SUPPORT = 1/ZSTD_SUPPORT = 0/' \
28+
-e 's/LZ4_SUPPORT = 1/LZ4_SUPPORT = 0/' \
29+
-e 's/USE_PREBUILT_MANPAGES = n/USE_PREBUILT_MANPAGES = y/' \
30+
Makefile
1231
ENV CFLAGS="-O2 -Wall -static"
1332
ENV LDFLAGS="-static"
33+
1434
RUN make -j`nproc` && make install INSTALL_DIR=/usr/obj/usr/bin
1535

1636
## copy final squashfs-tools into a scratch image

0 commit comments

Comments
 (0)