Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suddenly missing .bin in node_modules with node:22-alpine #2121

Closed
hnykda opened this issue Jul 19, 2024 · 1 comment
Closed

Suddenly missing .bin in node_modules with node:22-alpine #2121

hnykda opened this issue Jul 19, 2024 · 1 comment

Comments

@hnykda
Copy link

hnykda commented Jul 19, 2024

Hi. I suspect this is related to something specific to our configuration, as I don't see anyone else experiencing this. We have a fairly simple dockerfile:

FROM node:22-alpine

RUN mkdir -p /src
WORKDIR /src

RUN apk update && apk add build-base python3

COPY package.json package-lock.json ./
RUN npm ci

COPY next.config.js middleware.ts sentry.client.config.ts sentry.server.config.ts sentry.edge.config.ts tailwind.config.js tsconfig.json webpack.config.js postcss.config.js ./

COPY lib lib
COPY app app
COPY scripts scripts

it worked totally fine, but today it broke: node_modules/.bin is simply missing. It worked fine with node:22-alpine@sha256:ba898e86c2cc720c8cf2ae05f8d2d4697fe0c8ca3e920d6fbf14a6cbf50bb9ca, but node:22-alpine@sha256:f200d5ce9f0c43df6f3a6b97b692f998cce270f1409864de5fbb2e61836121f2 misses node_modules/.bin for whatever reason. That's on an exactly same code without any changes but the base image sha.

Environment

  • Platform: any
  • Docker Version: 26.1.3
  • Node.js Version: 22
Full env
  /usr/bin/docker version
  Client: Docker Engine - Community
   Version:           26.1.3
   API version:       1.45
   Go version:        go1.21.10
   Git commit:        b72abbb
   Built:             Thu May 16 08:33:29 2024
   OS/Arch:           linux/amd64
   Context:           default
  
  Server: Docker Engine - Community
   Engine:
    Version:          26.1.3
    API version:      1.45 (minimum version 1.24)
    Go version:       go1.21.10
    Git commit:       8e96db1
    Built:            Thu May 16 08:33:29 2024
    OS/Arch:          linux/amd64
    Experimental:     false
   containerd:
    Version:          1.7.18
    GitCommit:        ae71819c4f5e67bb4d5ae76a6b735f29cc25774e
   runc:
    Version:          1.7.18
    GitCommit:        v1.1.13-0-g58aa920
   docker-init:
    Version:          0.19.0
    GitCommit:        de40ad0
  /usr/bin/docker info
  Client: Docker Engine - Community
   Version:    26.1.3
   Context:    default
   Debug Mode: false
   Plugins:
    buildx: Docker Buildx (Docker Inc.)
      Version:  v0.16.0
      Path:     /usr/libexec/docker/cli-plugins/docker-buildx
    compose: Docker Compose (Docker Inc.)
      Version:  v2.27.1
      Path:     /usr/libexec/docker/cli-plugins/docker-compose
  
  Server:
   Containers: 1
    Running: 1
    Paused: 0
    Stopped: 0
   Images: 15
   Server Version: 26.1.3
   Storage Driver: overlay2
    Backing Filesystem: extfs
    Supports d_type: true
    Using metacopy: false
    Native Overlay Diff: false
    userxattr: false
   Logging Driver: json-file
   Cgroup Driver: cgroupfs
   Cgroup Version: 2
   Plugins:
    Volume: local
    Network: bridge host ipvlan macvlan null overlay
    Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
   Swarm: inactive
   Runtimes: io.containerd.runc.v2 runc
   Default Runtime: runc
   Init Binary: docker-init
   containerd version: ae71819c4f5e67bb4d5ae76a6b735f29cc25774e
   runc version: v1.1.13-0-g58aa920
   init version: de40ad0
   Security Options:
    apparmor
    seccomp
     Profile: builtin
    cgroupns
   Kernel Version: 6.5.0-1023-azure
   Operating System: Ubuntu 22.04.4 LTS
   OSType: linux
   Architecture: x86_64
   CPUs: 2
   Total Memory: 7.744GiB
   Name: fv-az1094-897
   ID: 70b54bab-f7c4-4333-a94b-def3ee959db6
   Docker Root Dir: /var/lib/docker
   Debug Mode: false
   Username: githubactions
   Experimental: false
   Insecure Registries:
    127.0.0.0/8

Working
 => [internal] load build definition from Dockerfile                                                                            0.0s  => => transferring dockerfile: 485B                                                                                            0.0s
 => [internal] load metadata for docker.io/library/node:22-alpine@sha256:ba898e86c2cc720c8cf2ae05f8d2d4697fe0c8ca3e920d6fbf14a  1.4s  => [internal] load .dockerignore                                                                                               0.0s
 => => transferring context: 342B                                                                                               0.0s  => [ 1/10] FROM docker.io/library/node:22-alpine@sha256:ba898e86c2cc720c8cf2ae05f8d2d4697fe0c8ca3e920d6fbf14a6cbf50bb9ca       5.1s
 => => resolve docker.io/library/node:22-alpine@sha256:ba898e86c2cc720c8cf2ae05f8d2d4697fe0c8ca3e920d6fbf14a6cbf50bb9ca         0.0s  => => sha256:5155adf0195a7bd447a0b0c6317a4d14d274f28339aef1fe7070c9c4b0e553ff 446B / 446B                                      0.7s
 => => sha256:ef51b21b47ac934c71cdecda24bc8b0da212f4d4629559b5e9accff9c062b8d5 1.39MB / 1.39MB                                  0.3sj => => sha256:6499a07b73018333b7e256641e56a3945ea23ceb0182601231c6b9f998270522 47.14MB / 47.14MB                                3.6s
 => => extracting sha256:6499a07b73018333b7e256641e56a3945ea23ceb0182601231c6b9f998270522                                       1.4s  => => extracting sha256:ef51b21b47ac934c71cdecda24bc8b0da212f4d4629559b5e9accff9c062b8d5                                       0.0s
 => => extracting sha256:5155adf0195a7bd447a0b0c6317a4d14d274f28339aef1fe7070c9c4b0e553ff                                       0.0s  => [internal] load build context                                                                                               0.0s
 => => transferring context: 40.40kB                                                                                            0.0s  => [ 2/10] RUN mkdir -p /src                                                                                                   1.4s
 => [ 3/10] WORKDIR /src                                                                                                        0.0s  => [ 4/10] RUN apk update && apk add build-base python3                                                                        8.0s
 => [ 5/10] COPY package.json package-lock.json ./                                                                              0.1s  => [ 6/10] RUN npm ci                                                                                                         94.6s
 => [ 7/10] COPY next.config.js middleware.ts sentry.client.config.ts sentry.server.config.ts sentry.edge.config.ts tailwind.c  1.9s  => [ 8/10] COPY lib lib                                                                                                        0.1s
 => [ 9/10] COPY app app                                                                                                        0.1s  => [10/10] COPY scripts scripts                                                                                                0.0s
 => exporting to image                                                                                                        667.6s  => => exporting layers                                                                                                       473.5s
 => => exporting manifest sha256:035a3e59f9af142aa21d3ffcd512eb1f53f9b381e014af7887ddeda336c5d10c                               0.0s  => => exporting config sha256:25725e0767af39908244a58ae4cd7f989607e568503393276151d8917057e792                                 0.0s
 => => exporting attestation manifest sha256:401de4ce7562c4e43880e8a4f09ce5c00d0933d0c127fc5e1dd3561e7aebe95e                   0.0s  => => exporting manifest list sha256:7bfeec1cfb1275832c0eec8c3675953aece782f70f34b3abb6a1028dfc96471c                          0.0s
 => => naming to docker.io/library/runner-f:latest                                                                              0.1s  => => unpacking to docker.io/library/runner-f:latest                                                                         193.8s

View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/k6nw3e1ylukq6cm02nneycf3s
⏎
[I] ❰dan❙~/work/varuna/code/varuna(git✱rename-and-fix-key-error)❱✔≻ docker run --rm -ti --entrypoint sh runner-f
/src # ls ^C

/src # npx tsx
Welcome to Node.js v22.4.1.
Type ".help" for more information.
>
/src #
Not working
[I] ❰dan❙~/work/varuna/code/varuna(git✱rename-and-fix-key-error)❱✔≻ docker buildx build -t runner-f-b .
[+] Building 1.3s (15/15) FINISHED                                                                              docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                                            0.0s
 => => transferring dockerfile: 631B                                                                                            0.0s
 => [internal] load metadata for docker.io/library/node:22-alpine@sha256:f200d5ce9f0c43df6f3a6b97b692f998cce270f1409864de5fbb2  1.0s
 => [internal] load .dockerignore                                                                                               0.0s
 => => transferring context: 342B                                                                                               0.0s
 => [ 1/10] FROM docker.io/library/node:22-alpine@sha256:f200d5ce9f0c43df6f3a6b97b692f998cce270f1409864de5fbb2e61836121f2       0.0s
 => => resolve docker.io/library/node:22-alpine@sha256:f200d5ce9f0c43df6f3a6b97b692f998cce270f1409864de5fbb2e61836121f2         0.0s
 => [internal] load build context                                                                                               0.1s
 => => transferring context: 40.40kB                                                                                            0.0s
 => CACHED [ 2/10] RUN mkdir -p /src                                                                                            0.0s
 => CACHED [ 3/10] WORKDIR /src                                                                                                 0.0s
 => CACHED [ 4/10] RUN apk update && apk add build-base python3                                                                 0.0s
 => CACHED [ 5/10] COPY package.json package-lock.json ./                                                                       0.0s
 => CACHED [ 6/10] RUN npm ci                                                                                                   0.0s
 => CACHED [ 7/10] COPY next.config.js middleware.ts sentry.client.config.ts sentry.server.config.ts sentry.edge.config.ts tai  0.0s
 => CACHED [ 8/10] COPY lib lib                                                                                                 0.0s
 => CACHED [ 9/10] COPY app app                                                                                                 0.0s
 => CACHED [10/10] COPY scripts scripts                                                                                         0.0s
 => exporting to image                                                                                                          0.1s
 => => exporting layers                                                                                                         0.0s
 => => exporting manifest sha256:335a957071c23158c9b9c7188099a7c9cf9034219887a832d968467a5684a49d                               0.0s
 => => exporting config sha256:1018c1e470e59158e93a7c261abdb8191b96e305eebb7282ee7360a428b14a97                                 0.0s
 => => exporting attestation manifest sha256:54526634cce50130e640bb0dffef48399229ad33518e1eebfa9d2ec08fb8c99a                   0.0s
 => => exporting manifest list sha256:4bde5b80ab32a3d4e2cbdae08f118c516739b308fd40660560f0caaab29ef9b2                          0.0s
 => => naming to docker.io/library/runner-f-b:latest                                                                            0.0s
 => => unpacking to docker.io/library/runner-f-b:latest                                                                         0.0s

View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/k9tgp1pe38q27jib44wrjq4x7
[I] ❰dan❙~/work/varuna/code/varuna(git✱rename-and-fix-key-error)❱✔≻ docker run --rm -ti --entrypoint sh runner-f-b
/src # npx tsx
sh: tsx: not found
/src # ls node_modules/.bin
ls: node_modules/.bin: No such file or directory

Expected Behavior

.bin being present in node_modules

Current Behavior

.bin is missing

Steps to Reproduce

Sorry, can't share the full code.

@SimenB
Copy link
Member

SimenB commented Jul 19, 2024

Presumably fixed, ref https://x.com/nodejs/status/1814323839708656060

(Note that you'll need to wait for #2122 (comment))

If not, we'll need a reproduction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants