feat: package nodejs

This commit is contained in:
Lance R. Vick 2024-04-15 11:05:37 -07:00
parent 7b48ba8c85
commit e6dd8456b8
No known key found for this signature in database
GPG key ID: 8E47A1EC35A1551D
2 changed files with 58 additions and 0 deletions

View file

@ -0,0 +1,40 @@
FROM scratch as base
ENV VERSION=20.11.1
ENV SRC_HASH=4af1ba6ea848cc05908b8a62b02fb27684dd52b2a7988ee82b0cfa72deb90b94
ENV SRC_FILE=node-v${VERSION}.tar.gz
ENV SRC_SITE=https://nodejs.org/dist/v${VERSION}/${SRC_FILE}
ENV CFLAGS="-march=x86-64 -mtune=generic -O2"
FROM base as fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
FROM fetch as build
COPY --from=stagex/busybox . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/musl . /
COPY --from=stagex/openssl . /
COPY --from=stagex/python . /
COPY --from=stagex/bzip2 . /
COPY --from=stagex/ninja . /
COPY --from=stagex/zlib . /
COPY --from=stagex/linux-headers . /
RUN tar -xf ${SRC_FILE}
WORKDIR node-v${VERSION}
RUN --network=none <<-EOF
set -eux
python configure.py \
--without-snapshot
make BUILDTYPE=Release
EOF
FROM build as install
RUN --network=none <<-EOF
set -eux
make DESTDIR=/rootfs install
find /rootfs -exec touch -hcd "@0" "{}" +
EOF
FROM stagex/filesystem as package
COPY --from=install /rootfs/. /

View file

@ -2239,6 +2239,24 @@ out/ninja/index.json: \
out/python/index.json
$(call build,ninja)
.PHONY: nodejs
nodejs: out/nodejs/index.json
out/nodejs/index.json: \
packages/nodejs/Containerfile \
out/binutils/index.json \
out/busybox/index.json \
out/bzip2/index.json \
out/filesystem/index.json \
out/gcc/index.json \
out/linux-headers/index.json \
out/make/index.json \
out/musl/index.json \
out/ninja/index.json \
out/openssl/index.json \
out/python/index.json \
out/zlib/index.json
$(call build,nodejs)
.PHONY: npth
npth: out/npth/index.json
out/npth/index.json: \