nodejs

Source

FROM scratch AS build
ARG VERSION
COPY --from=stagex/core-busybox . /
COPY --from=stagex/core-llvm . /
COPY --from=stagex/core-libzstd . /
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-libffi . /
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 CC=clang
ENV CXX=clang++
#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"
#ENV CPPFLAGS="$CXXFLAGS"
#ENV LTOFLAGS="-flto=auto"
ADD patches/* .
RUN --network=none <<-EOF
	set -eux
	patch -p1 < no-libatomic.patch
	python configure.py \
		--prefix=/usr \
		--ninja \
		--openssl-use-def-ca-store \
		--shared-zlib \
		--shared-brotli \
		--shared-cares \
		--shared-nghttp2 \
		--shared-openssl \
		--shared-zlib \
		--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/ /
Copied to clipboard!