WIP nodejs

This commit is contained in:
Lance Vick 2024-01-31 14:18:24 -08:00
parent e052722c12
commit d71bd9af57
Signed by: lrvick
GPG Key ID: 8E47A1EC35A1551D
2 changed files with 71 additions and 0 deletions

View File

@ -4,6 +4,7 @@ core: \
out/go.tgz \
out/python.tgz \
out/perl.tgz \
out/nodejs.tgz \
out/gcc.tgz \
out/llvm.tgz
@ -137,6 +138,26 @@ out/python.tgz: \
out/musl.tgz
$(call build,core,python)
out/nodejs.tgz: \
out/gcc.tgz \
out/busybox.tgz \
out/openssl.tgz \
out/python.tgz \
out/ninja.tgz \
out/make.tgz \
out/musl.tgz
$(call build,core,nodejs)
out/npm.tgz: \
out/gcc.tgz \
out/busybox.tgz \
out/openssl.tgz \
out/python.tgz \
out/ninja.tgz \
out/make.tgz \
out/musl.tgz
$(call build,core,nodejs)
out/ninja.tgz: \
out/busybox.tgz \
out/gcc.tgz \

View File

@ -0,0 +1,50 @@
ARG REGISTRY=local
FROM ${REGISTRY}/busybox as busybox
FROM ${REGISTRY}/gcc as gcc
FROM ${REGISTRY}/musl as musl
FROM ${REGISTRY}/openssl as openssl
FROM ${REGISTRY}/python as python
FROM ${REGISTRY}/ninja as ninja
FROM ${REGISTRY}/openssl as openssl
FROM ${REGISTRY}/make as make
FROM busybox as base
ENV VERSION=20.11.0
ENV SRC_FILE=node-v${VERSION}.tar.gz
ENV SRC_SITE=https://nodejs.org/dist
ENV SRC_HASH=9884b22d88554d65025352ba7e4cb20f5d17a939231bea41a7894c0344fab1bf
COPY --from=musl . /
COPY --from=gcc . /
COPY --from=ninja . /
COPY --from=python . /
COPY --from=openssl . /
FROM base as fetch
RUN wget --no-check-certificate ${SRC_SITE}/v${VERSION}/${SRC_FILE}
RUN echo "${SRC_HASH} ${SRC_FILE}" | sha256sum -c
FROM fetch as build
RUN tar -xzf ${SRC_FILE}
WORKDIR build
RUN set -eux; \
../node-v${VERSION}/configure \
--prefix=/usr \
--ninja \
--enable-lto \
--openssl-use-def-ca-store \
--without-corepack \
--without-npm; \
make BUILDTYPE=Release
FROM build as install
USER 0:0
COPY --from=musl /lib/* /rootfs/lib/
RUN set -eux; \
make PREFIX=/rootfs install; \
find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package
COPY --from=install /rootfs /
USER 100:100
ENTRYPOINT ["/usr/bin/node"]
CMD ["--version"]