Skip to content

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

@pascalandy

Description

@pascalandy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions