nodejs / docker-node

Official Docker Image for Node.js :whale: :turtle: :rocket:
https://hub.docker.com/_/node/
MIT License
8.24k stars 1.97k forks source link

node:18 (bookworm) lacks libcrypto.so.1.1 present in previous releases such as 18-bullseye #1916

Open steven-supersolid opened 1 year ago

steven-supersolid commented 1 year ago

Environment

Expected Behavior

libcrypto.so.1.1 is findable on the system with node:18-bullseye

# whereis libcrypto.so.1.1
libcrypto.so.1: /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1

Current Behavior

libcrypto.so.1.1 is not present

# whereis libcrypto.so.1.1
libcrypto.so.1.1:
# ls /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
ls: cannot access '/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1': No such file or directory

Possible Solution

This started happening after the recent update to bookworm and installing node:18-bullseye works as expected

Steps to Reproduce

  1. docker pull node:18
  2. docker run -it node:18 bash
  3. whereis libcrypto.so.1.1

Additional Information

This breaks any CI that uses node:18 and https://github.com/nodkz/mongodb-memory-server as the mongodb binary requires libcrypto.so.1.1

MandarDevarshi commented 1 year ago

See if this helps https://github.com/nodejs/docker-node/issues/1915#issuecomment-1589387922

waitingsong commented 1 year ago

https://www.debian.org/releases/bookworm/amd64/release-notes/ch-whats-new.en.html#newdistro OpenSSL from 1.1.1n to 3.0.8

ziedHamdi commented 11 months ago

Worked for me too with 18-bullseye.

For anyone new to CircleCi like me, here's my entire config.yml

# fonud here https://pnpm.io/continuous-integration
version: 2.1

jobs:
  build: # this can be any name you choose
    docker:
      - image: node:18-bullseye #raw 18 fails: https://github.com/nodejs/docker-node/issues/1916
    resource_class: large
    parallelism: 10

    steps:
      - checkout
      - restore_cache:
          name: Restore pnpm Package Cache
          keys:
            - pnpm-packages-{{ checksum "pnpm-lock.yaml" }}
      - run:
          name: Install pnpm package manager
          command: |
            corepack enable
            corepack prepare pnpm@latest-8 --activate
      - run:
          name: Install Dependencies
          command: |
            pnpm install
      - save_cache:
          name: Save pnpm Package Cache
          key: pnpm-packages-{{ checksum "pnpm-lock.yaml" }}
          paths:
            - node_modules
      - run:
          name: Test with jest
          command: |
            node --experimental-vm-modules node_modules/jest/bin/jest.js
Vittorio-QA commented 7 months ago

Having this issue with node:20, trying to use a different image.

UPDATE: running node:20-buster - from docker hub solves the issue.

davidgarra commented 1 month ago

I just tried with Bullseye 22 (the latest version) and it works. This also solves the problem with Node 20 and the slow tests.

LaurentGoderre commented 2 weeks ago

libcrypto was not explicitly installed from any of the images on which Node images are built. It likely was included in bullseye as a transitive dependency of one of the buildpack-deps package installed and that package doesn't rely on libcrypto anymore in bookworm and more recent versions.

If you explicitly depend on that library, I would strongly recommend adding it to your Dockerfile.