@@ -15,6 +15,12 @@ FROM ghcr.io/renovatebot/base-image:2.28.0-full@sha256:0e3a859452ece1442faa693c7
15
15
# --------------------------------------
16
16
FROM --platform=$BUILDPLATFORM ghcr.io/renovatebot/base-image:2.28.0@sha256:0abd37cc5818199aad69b226537fade5047bae1ca1a987f855453d9eed19a795 AS build
17
17
18
+ # We want a specific node version here
19
+ # renovate: datasource=node-version
20
+ RUN install-tool node 20.15.1
21
+
22
+ WORKDIR /usr/local/renovate
23
+
18
24
ARG TARGETPLATFORM
19
25
ARG BUILDPLATFORM
20
26
@@ -23,11 +29,21 @@ RUN set -ex; \
23
29
uname -a; \
24
30
true
25
31
26
- WORKDIR /usr/local/renovate
32
+ # fetch static node binary
33
+ # trim `linux/` from TARGETPLATFORM
34
+ # replace `amd64` with `x64` for `node`
35
+ RUN set -ex; \
36
+ ver=$(node --version); \
37
+ arch=${TARGETPLATFORM:6}; \
38
+ temp_dir="$(mktemp -d)" ; \
39
+ curl -fsSL https://nodejs.org/dist/${ver}/node-${ver}-linux-${arch/amd64/x64}.tar.xz -o ${temp_dir}/node.tar.xz; \
40
+ bsdtar --strip 1 -C ${temp_dir} -xf ${temp_dir}/node.tar.xz; \
41
+ cp ${temp_dir}/bin/node ./node; \
42
+ true
27
43
44
+ # fetch npm packages
28
45
ENV CI=1 npm_config_modules_cache_max_age=0 \
29
- npm_config_loglevel=info \
30
- ARCH=arm64
46
+ npm_config_loglevel=info
31
47
32
48
COPY pnpm-lock.yaml ./
33
49
@@ -44,20 +60,11 @@ RUN set -ex; \
44
60
45
61
COPY . ./
46
62
47
- # install
63
+ # install npm packages
48
64
RUN set -ex; \
49
65
corepack pnpm install --prod --offline --ignore-scripts; \
50
66
true
51
67
52
- # test
53
- COPY tools/docker/bin/ /usr/local/bin/
54
- # RE2 doesn't work on cross compile
55
- ENV RENOVATE_X_IGNORE_RE2=true
56
- RUN set -ex; \
57
- renovate --version; \
58
- renovate-config-validator; \
59
- true
60
-
61
68
# --------------------------------------
62
69
# final image
63
70
# --------------------------------------
@@ -87,7 +94,7 @@ RUN set -ex; \
87
94
88
95
RUN set -ex; \
89
96
renovate --version; \
90
- node -e "new require('re2')('.*').exec('test');new require('better-sqlite3')(':memory:')" ; \
97
+ /usr/local/renovate/ node -e "new require('re2')('.*').exec('test');new require('better-sqlite3')(':memory:')" ; \
91
98
true
92
99
93
100
LABEL \
0 commit comments