forked from devttys0/sasquatch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a Dockerfile to enable a portable build environment. The Dockerfile is based on Ubuntu 24.04, and uses multiple stages to produce a minimal final product, with the final image size sitting at about 75mb. This branch also incorporates the updates prepared by @cole-h to update to squashfs-tools 4.4 in devttys0#56. Finally, building on newer GCC highlights a dangling pointer error in LzmaEnc.c. I have separated the fix for this problem into a dedicated patch file for ease of review.
- Loading branch information
Showing
4 changed files
with
4,778 additions
and
4,503 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
FROM ubuntu:24.04 AS builder | ||
|
||
RUN --mount=type=cache,target=/var/cache/apt,id=builder-apt-cache \ | ||
--mount=type=cache,target=/var/lib/apt,id=builder-apt-lib \ | ||
apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
git \ | ||
liblzma-dev \ | ||
liblzo2-dev \ | ||
patch \ | ||
zlib1g-dev \ | ||
&& mkdir -p /sasquatch | ||
|
||
WORKDIR /sasquatch | ||
|
||
ADD https://downloads.sourceforge.net/project/squashfs/squashfs/squashfs4.4/squashfs4.4.tar.gz . | ||
RUN tar -zxvf squashfs4.4.tar.gz | ||
|
||
COPY patches /sasquatch/patches | ||
RUN patch -d squashfs4.4 -p1 < patches/0_sasquatch_4.4.patch && \ | ||
patch -d squashfs4.4 -p1 < patches/1_fix_dangling_pointer.patch && \ | ||
cd squashfs4.4/squashfs-tools && \ | ||
make | ||
|
||
FROM ubuntu:24.04 | ||
|
||
RUN --mount=type=cache,target=/var/cache/apt,id=runtime-apt-cache \ | ||
--mount=type=cache,target=/var/lib/apt,id=runtime-apt-lib \ | ||
apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
liblzma5 \ | ||
liblzo2-2 \ | ||
zlib1g | ||
|
||
COPY --from=builder /sasquatch/squashfs4.4/squashfs-tools/sasquatch /usr/local/bin/sasquatch | ||
|
||
WORKDIR /work | ||
|
||
ENTRYPOINT [ "/usr/local/bin/sasquatch" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.