Commit c0d0bff
root: bind-mount .npmrc into Dockerfile npm ci stages (#22462)
* root: bind-mount .npmrc into Dockerfile npm ci stages
`npm` walks up from cwd looking for `.npmrc`. The two Dockerfiles that
run `npm ci` (`lifecycle/container/Dockerfile` for the web build and
`website/Dockerfile` for the docs build) bind-mount package.json /
package-lock.json into the build context, but not `.npmrc`. As a result
the project-level settings — most importantly `ignore-scripts=true` —
are not honored inside the container, so a hypothetical malicious
package's preinstall/postinstall hook would execute during the image
build.
Adding `--mount=type=bind,target=/work/.npmrc,src=./.npmrc` to each
`npm ci` step closes that gap. The mount is read-only and only present
for the install step, so it adds no layer weight.
Co-authored-by: Agent <279763771+playpen-agent@users.noreply.github.com>
* Update bindmount.
---------
Co-authored-by: Agent <279763771+playpen-agent@users.noreply.github.com>1 parent 85d645d commit c0d0bff
3 files changed
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
0 commit comments