aws / aws/aws-codebuild-docker-images

Running npm the first time on `aws/codebuild/standard:7.0` takes 12 seconds

Open
#723 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dockerfile
Stars
1.2k
Forks
971
Avg merge
2h 47m
Merged PRs (30d)
1

Description

Running `npm` CLI for the first time on CodeBuild takes 12s seconds. And that's in 15 GB memory, 8 vCPUs.

```
root@4caf6b2d0339:/tmp# time npm -v
10.2.4

real 0m12.660s
user 0m0.261s
sys 0m0.079s
```

I suspect it has something to do with corepack. It silently tries to update `npm` or maybe `apt-get`; I think it has a similar behaviour.

But I tried disabling corepack via `corepack disable` and also setting various env options to turn off different behaviours. But nothing seems to have any effect.

Any ideas?

Shouldn't npm be pre-installed by default?

---

![screenshot-20240602T203145-hnKh4PS1@2x](https://github.com/aws/aws-codebuild-docker-images/assets/491247/ad3985d7-1ced-4bb0-837f-8cef65485f3b)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.