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

Transition from Alpine to Debian: Multi-Stage Builds for Node.js 16 and 18 Docker Images #566

Open
pascalandy opened this issue Nov 27, 2024 · 0 comments

Comments

@pascalandy
Copy link

pascalandy commented Nov 27, 2024

Overview

This pull request introduces a significant enhancement to our Node.js Docker images by transitioning from Alpine to Debian-based images. The update incorporates multi-stage builds for Node.js 18, improving the overall efficiency and performance of our Docker containers.

Transition from Alpine to Debian:

  • The switch to Debian provides a more stable and robust environment for running Node.js applications. This change addresses compatibility issues that some users have experienced with Alpine, particularly regarding native module dependencies.

Ref

by [[Bret Fisher]]

https://hub.docker.com/_/node

  • node:18.20.5-bullseye-slim

https://hub.docker.com/_/ubuntu

  • ubuntu:noble-20241015 (latest aka v24.04 as [[2024-11-26]])
FROM node:18.20.5-bullseye-slim as node
FROM ubuntu:noble-20241015 as base
COPY --from=node /usr/local/ /usr/local/
# this ensures we fix simlinks for npx, Yarn, and PnPm
RUN corepack disable && corepack enable
ENTRYPOINT ["/usr/local/bin/node"]

# rest of your stuff goes here
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

1 participant