Skip to content

Commit 39c6baf

Browse files
committed
chore(tools/node): refactor build scripts and move configuration to bin directory
1 parent cba1b71 commit 39c6baf

File tree

5 files changed

+30
-18
lines changed

5 files changed

+30
-18
lines changed

tools/node/Dockerfile

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# syntax=docker.io/docker/dockerfile-upstream:1.14.0-labs
2-
31
FROM builder AS build
42

53
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
@@ -15,15 +13,23 @@ RUN mkdir -p ${TOOL_DIR}
1513
ENV BUILDER_DIR=${TOOLS_ROOT}/builders/${TOOL_NAME}
1614
RUN mkdir -p ${BUILDER_DIR}
1715

16+
ENV BUILDER_WORK_DIR=${BUILDER_DIR}/work
17+
RUN mkdir -p ${BUILDER_WORK_DIR}
18+
WORKDIR ${BUILDER_WORK_DIR}
19+
1820
ENV BUILDER_ENV_FILE=${BUILDER_DIR}/.env
1921
RUN touch ${BUILDER_ENV_FILE}
2022

23+
ENV BUILDER_BIN_DIR=${BUILDER_DIR}/bin
24+
RUN mkdir -p ${BUILDER_BIN_DIR}
25+
COPY --chmod=0755 ./builder/bin/* ${BUILDER_BIN_DIR}/
26+
2127
ARG NODE_VERSION=22.18.0
2228
ENV NODE_VERSION=${NODE_VERSION}
2329

24-
COPY --chmod=0755 ./builder/* ${BUILDER_DIR}/
25-
RUN ${BUILDER_DIR}/0-configure.sh
26-
RUN ${BUILDER_DIR}/1-install.sh
30+
RUN ${BUILDER_BIN_DIR}/0-configure.sh
31+
RUN ${BUILDER_BIN_DIR}/1-download.sh
32+
RUN ${BUILDER_BIN_DIR}/2-install.sh
2733

2834
# Vendor non-glibc shared libraries
2935
RUN vendor-dependencies.sh ${TOOL_DIR}

tools/node/builder/1-install.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#! /bin/bash
2+
3+
set -ex
4+
5+
export $(cat $BUILDER_ENV_FILE)
6+
7+
curl -fsSL -o node.tar.xz https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-$NODE_ARCH.tar.xz
8+
tar -xJf node.tar.xz
9+
rm node.tar.xz
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#! /bin/sh
2+
3+
set -eux
4+
5+
export $(cat $BUILDER_ENV_FILE)
6+
7+
mv node-v$NODE_VERSION-$NODE_ARCH/bin $TOOL_DIR/
8+
mv node-v$NODE_VERSION-$NODE_ARCH/include $TOOL_DIR/
9+
mv node-v$NODE_VERSION-$NODE_ARCH/lib $TOOL_DIR/
10+
mv node-v$NODE_VERSION-$NODE_ARCH/share $TOOL_DIR/

0 commit comments

Comments
 (0)