fix(ci): cache node in install smoke image
This commit is contained in:
parent
c3b05fc4d9
commit
bbfeb0b6f9
@ -21,6 +21,15 @@ RUN --mount=type=cache,id=openclaw-install-sh-nonroot-apt-cache,target=/var/cach
|
|||||||
python3 \
|
python3 \
|
||||||
sudo
|
sudo
|
||||||
|
|
||||||
|
# Preinstall the supported Node runtime in a cacheable build layer so the
|
||||||
|
# non-root smoke covers user-local npm prefixing and missing git without paying
|
||||||
|
# the full NodeSource bootstrap cost on every container run.
|
||||||
|
RUN --mount=type=cache,id=openclaw-install-sh-nonroot-apt-cache,target=/var/cache/apt,sharing=locked \
|
||||||
|
--mount=type=cache,id=openclaw-install-sh-nonroot-apt-lists,target=/var/lib/apt,sharing=locked \
|
||||||
|
set -eux; \
|
||||||
|
curl -fsSL https://deb.nodesource.com/setup_24.x | bash -; \
|
||||||
|
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends nodejs
|
||||||
|
|
||||||
RUN useradd -m -s /bin/bash app \
|
RUN useradd -m -s /bin/bash app \
|
||||||
&& echo "app ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/app
|
&& echo "app ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/app
|
||||||
|
|
||||||
|
|||||||
@ -15,6 +15,19 @@ if command -v git >/dev/null; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "==> Pre-flight: ensure supported Node is already present"
|
||||||
|
node -e '
|
||||||
|
const version = process.versions.node.split(".").map(Number);
|
||||||
|
const ok =
|
||||||
|
version.length >= 2 &&
|
||||||
|
(version[0] > 22 || (version[0] === 22 && version[1] >= 16));
|
||||||
|
if (!ok) {
|
||||||
|
process.stderr.write(`unsupported node ${process.versions.node}\n`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
'
|
||||||
|
command -v npm >/dev/null
|
||||||
|
|
||||||
echo "==> Run installer (non-root user)"
|
echo "==> Run installer (non-root user)"
|
||||||
curl -fsSL "$INSTALL_URL" | bash
|
curl -fsSL "$INSTALL_URL" | bash
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user