Last active
February 22, 2024 05:31
-
-
Save dkam/eb57697b73c7c4b210bc7ab8fe43b97a to your computer and use it in GitHub Desktop.
Docker build stage for JXL
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
#... | |
WORKDIR /rails | |
#... | |
# https://github.com/libjxl/libjxl/blob/main/BUILDING.md | |
FROM base as buildjxl | |
ENV CC=clang | |
ENV CXX=clang++ | |
RUN apt-get update -qq && \ | |
apt-get install --no-install-recommends -y git cmake pkg-config libbrotli-dev libgif-dev libjpeg-dev libopenexr-dev libpng-dev libwebp-dev clang make build-essential && \ | |
git clone https://github.com/libjxl/libjxl.git --recursive --shallow-submodules && \ | |
cd libjxl && git submodule update --init --recursive --depth 1 --recommend-shallow | |
RUN cd libjxl && mkdir build && cd build && \ | |
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF .. && \ | |
cmake --build . -- -j$(nproc) && ls -l tools | |
# Sometime later in the final stage.... | |
COPY --from=buildjxl /rails/libjxl/build/tools/cjxl bin/ | |
COPY --from=buildjxl /rails/libjxl/build/tools/djxl bin/ | |
COPY --from=buildjxl /rails/libjxl/build/lib /rails/ | |
# The final layer will need `libgif7` installed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment