nodejs

Details
Source
FROM scratch AS build
ARG VERSION
COPY --from=stagex/core-busybox . /
COPY --from=stagex/core-gcc . /
COPY --from=stagex/core-binutils . /
COPY --from=stagex/core-make . /
COPY --from=stagex/core-musl . /
COPY --from=stagex/core-openssl . /
COPY --from=stagex/core-python . /
COPY --from=stagex/core-bzip2 . /
COPY --from=stagex/core-samurai . /
COPY --from=stagex/core-zlib . /
COPY --from=stagex/core-icu . /
COPY --from=stagex/core-linux-headers . /
COPY --from=stagex/core-libnghttp2 . /
COPY --from=stagex/core-brotli . /
COPY --from=stagex/core-c-ares . /
COPY --from=stagex/core-pkgconf . /
ADD fetch/nodejs-${VERSION}.tar.gz .
WORKDIR /node-v${VERSION}
ENV SOURCE_DATE_EPOCH=1
ENV LDFLAGS=" \
	-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro \
	-Wl,-z,now -Wl,-z,pack-relative-relocs"
ENV CFLAGS=" \
	-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \
	-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions \
	-Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security \
	-fstack-clash-protection -fcf-protection \
	-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"
ENV CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
ENV CPPFLAGS="$CXXFLAGS"
ENV LTOFLAGS="-flto=auto"
RUN --network=none <<-EOF
	set -eux
	python configure.py \
		--prefix=/usr \
		--ninja \
		--shared-zlib \
		--shared-nghttp2 \
		--shared-openssl \
		--shared-cares \
		--shared-brotli \
		--without-npm \
		--without-corepack \
		--with-intl=system-icu \
		--with-icu-default-data-dir=$(icu-config --icudatadir) \
		--openssl-use-def-ca-store
	make BUILDTYPE=Release -j $(nproc)
	make DESTDIR=/rootfs install
EOF
FROM stagex/core-filesystem AS package
COPY --from=build /rootfs/ /