stagex/packages/json-c/Containerfile

43 lines
1.1 KiB
Text
Raw Normal View History

2024-08-08 07:47:42 +00:00
FROM scratch AS base
2024-05-02 00:12:06 +00:00
ENV VERSION=0.17
ENV SRC_HASH=7550914d58fb63b2c3546f3ccfbe11f1c094147bd31a69dcd23714d7956159e6
ENV SRC_FILE=json-c-${VERSION}.tar.gz
ENV SRC_SITE=https://s3.amazonaws.com/json-c_releases/releases/${SRC_FILE}
2024-08-08 07:47:42 +00:00
FROM base AS fetch
2024-05-02 00:12:06 +00:00
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
2024-08-08 07:47:42 +00:00
FROM fetch AS build
2024-05-02 00:12:06 +00:00
COPY --from=stagex/busybox . /
COPY --from=stagex/binutils . /
COPY --from=stagex/cmake . /
COPY --from=stagex/ninja . /
COPY --from=stagex/musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/openssl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/zlib . /
RUN tar -xf ${SRC_FILE}
2024-08-26 01:18:52 +00:00
WORKDIR /json-c-${VERSION}
2024-05-02 00:12:06 +00:00
RUN <<-EOF
set -eux
cmake \
-B build \
-G Ninja \
-Wno-dev \
-DCMAKE_INSTALL_PREFIX=/usr/ \
-DCMAKE_INSTALL_LIBDIR=lib \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=ON \
-DCMAKE_SYSTEM_NAME=Linux \
-DCMAKE_HOST_SYSTEM_NAME=Linux
cmake --build build --target all
EOF
2024-08-08 07:47:42 +00:00
FROM build AS install
2024-05-02 00:12:06 +00:00
RUN --network=none DESTDIR="/rootfs" cmake --install build
2024-08-08 07:47:42 +00:00
FROM stagex/filesystem AS package
2024-05-02 00:12:06 +00:00
COPY --from=install /rootfs/. /