forked from gsd-build/gsd-2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
69 lines (60 loc) · 3.15 KB
/
Copy pathDockerfile
File metadata and controls
69 lines (60 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# ──────────────────────────────────────────────
# Runtime
# Image: ghcr.io/gsd-build/gsd-pi
# Used by: end users via docker run
# ──────────────────────────────────────────────
FROM node:24-slim AS runtime
# Git is required for GSD's git operations
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
&& rm -rf /var/lib/apt/lists/*
# Install GSD globally — version is controlled by the build arg
ARG GSD_VERSION=latest
RUN npm install -g gsd-pi@${GSD_VERSION}
# Default working directory for user projects
WORKDIR /workspace
ENTRYPOINT ["gsd"]
CMD ["--help"]
# ──────────────────────────────────────────────
# Runtime (local build)
# Image: ghcr.io/gsd-build/gsd-pi:local
# Used by: PR-time e2e smoke, builds the *current source* into an image
# instead of pulling from npm. Lets `tests/e2e/docker/` exercise the actual
# runtime container produced by this branch's code.
# Build with: docker build --target runtime-local \
# --build-arg TARBALL=gsd-pi-<version>.tgz -t gsd-pi:local .
# The tarball must be in the build context (created by `npm pack`).
# ──────────────────────────────────────────────
FROM node:24-slim AS runtime-local
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
&& rm -rf /var/lib/apt/lists/*
ARG TARBALL
COPY ${TARBALL} /tmp/gsd-pi.tgz
# Install with --ignore-scripts: postinstall is unnecessary for the
# version / help smoke this image is built for, and skipping it removes
# a class of network-dependent failures.
#
# Diagnostic output: list /usr/local/bin and the installed package layout
# so a regression here fails loudly at build time with the actual file
# state visible in CI logs (instead of silently producing an image that
# fails at run time with exit 127 / command not found).
#
# Verify the loader is invokable. We pin to `node /path/to/loader.js`
# (not the bin shim) because the npm bin shim is fragile against npm
# prefix drift inside slim images; running the loader directly always
# works as long as dist/ is in the tarball.
RUN npm install -g --ignore-scripts /tmp/gsd-pi.tgz \
&& rm /tmp/gsd-pi.tgz \
&& echo "--- /usr/local/bin ---" \
&& ls -la /usr/local/bin | grep -i gsd || echo "(no gsd entries in /usr/local/bin)" \
&& echo "--- /usr/local/lib/node_modules/gsd-pi ---" \
&& ls -la /usr/local/lib/node_modules/gsd-pi 2>/dev/null | head -10 \
&& test -f /usr/local/lib/node_modules/gsd-pi/dist/loader.js \
&& node /usr/local/lib/node_modules/gsd-pi/dist/loader.js --version
WORKDIR /workspace
# Invoke the loader directly. Avoids any dependency on the npm bin shim
# being placed correctly in /usr/local/bin (which is platform/prefix
# dependent and has been the source of spurious exit-127 failures).
ENTRYPOINT ["node", "/usr/local/lib/node_modules/gsd-pi/dist/loader.js"]
CMD ["--help"]