chore(deps): bump undici from 7.30.0 to 7.30.1 (#2667)
Bumps undici from 7.30.0 to 7.30.1.
updated-dependencies:
- dependency-name: undici dependency-version: 7.30.1 dependency-type: indirect …
Signed-off-by: dependabot[bot] support@github.com Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
Node.js
node - Docker Official Images on Docker Hub
The official Node.js docker image, made with love by the node community.
Table of Contents
Dockerfilein your Node.js app projectnode:<version>node:ltsnode:alpinenode:bookwormnode:trixienode:slimWhat is Node.js?
Node.js is a platform built on Chrome’s JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.
See: https://nodejs.org
How to use this image
Create a
Dockerfilein your Node.js app projectYou can then build and run the Docker image:
If you prefer Docker Compose:
You can then run using Docker Compose:
Docker Compose example mounts your current directory (including node_modules) to the container. It assumes that your application has a file named
package.jsondefining start script.Best Practices
We have assembled a Best Practices Guide for those using these images on a daily basis.
Run a single Node.js script
For many simple, single file projects, you may find it inconvenient to write a complete
Dockerfile. In such cases, you can run a Node.js script by using the Node.js Docker image directly:npm loglevel
The default npm loglevel is
notice, which includes also the levelswarnanderror. If you need to set a differentloglevelfor npm, follow these example instructions:Dockerfile
If you create your own
Dockerfilewhich inherits from thenodeimage, you can useENVto set theNPM_CONFIG_LOGLEVELenvironment variable.Docker Run
If you run the node image using
docker run, you can use the-eflag to set theNPM_CONFIG_LOGLEVELenvironment variable.npm run
If you are running npm commands, you can use the
--loglevelcommand line flag to control the verbosity of the output.Image Variants
The
nodeimages come in many flavors, each designed for a specific use case. All of the images contain pre-installed versions ofnodewhich includes alsonpm. For each supported architecture, the supported variants are different. In the file: versions.json, it lists all supported variants for all of the architectures that we support now.The legacy package manager Yarn v1 Classic is included in
nodeimages with Node.js 25 and below. See Yarn v1 Classic bundling for details.View the list of currently supported floating and pinned tags on Docker Hub.
node:<version>This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of. This tag is based off of
buildpack-deps.buildpack-depsis designed for the average user of docker who has many images on their system. It, by design, has a large number of extremely common Debian packages. This reduces the number of packages that images that derive from it need to install, thus reducing the overall size of all images on your system.node:ltsThis is a special form of
node:<version>that selects the Active Long Term Support version of Node.js. See also Long Term Support below for more detail.node:alpineThis image is based on Alpine Linux. Because base alpine images are smaller than corresponding base debian images, the resulting
node:alpineDocker images are around 25% smaller than the Debian-basednode:slimimages.Alpine images use the C library musl libc, not the GNU C library glibc used by Debian.
Generally, applications written for Debian (
glibc) will not run under Alpine (musl). Some compatibility issues may be resolvable by installing the AlpinegcompatGNU C Library compatibility layer for musl package. Useapk add --no-cache gcompatto install.Tools such as
gitorbashare not included innode:alpine*based images. The Alpine documentation describes how to find and install additional packages usingapk(Alpine Package Keeper).The Best Practices document, in the section Smaller images without npm/yarn, shows how to produce a custom image by removing package managers in a multi-stage build.
node:bookwormThis image is based on version 12 of Debian, available in the
debianofficial image.node:trixieThis image is based on version 13 of Debian, available in the
debianofficial image.node:slimThis image does not contain the common packages contained in the default tag and only contains the minimal packages needed to run
node. Unless you are working in an environment where only the Node.js image will be deployed and you have space constraints, we highly recommend using the default image of this repository.Long Term Support (LTS)
Production applications should only use LTS releases.
Refer to Node.js Releases for a description of release phases and schedule.
If no version selection is made in a tag, for example,
node:slim, then the Current release is selected.nodeimages using the Active LTS release are published with anltsfloating tag to aid their selection.node:ltscan be used on its own, or in combination with other tags such asnode:lts-slim. To select anodeimage based on a Maintenance LTS version use the literal node version in the tag.Release Availability
This repo automatically triggers a process to build new
nodeimages when Node.js releases become available. The build processes can take several hours to complete.Images may initially appear on Docker Hub with incomplete or missing OS/ARCH listings as the build process first publishes a tag and then backfills each architecture when ready. During this time, if you try to pull the image, you may see an error message “no matching manifest”. In this case, check back later. (See Docker Library FAQs for a detailed description of the complex build process.)
License
License information for the software contained in this image. License information for the Node.js Docker project.
Supported Docker versions
If you are using Docker Desktop, it is recommended to use a recent version, released in the last six months.
Refer to Docker Engine release notes for current Engine versions.
Supported Node.js versions
Support for
nodeDocker images is limited to Node.js active versions.Before opening an issue in this repo, please consider if the problem only occurs in a
nodeDocker environment.If a problem can also be reproduced without using an image from this repo, for example in a non-Docker environment, then it should be reported to the corresponding component.
Use the Node.js issues or the npm issues list to check for known issues or to report new issues for these components.
Supported architectures
nodeimages are built for the Linux operating system and architecture combinations defined in versions.json.Each of the architectures for Debian images belong to the Node.js support tier 1 or 2, recommended for production applications.
musl builds for Alpine
muslbuilds foramd64are listed under support tier “Experimental” and are tested by the Node.js build process before being used in Docker images. “Experimental” status for Node.js is defined as:muslbuilds for other architectures, includingarm64, are not tested before release.Yarn v1 Classic bundling
The Yarn v1 Classic package manager is bundled in
nodeimage variants that include Node.js versions 25 and below.Yarn v1 is not bundled into
nodeimages as of Node.js 26.0.0. This version of the Yarn package manager has been declared as frozen and is no longer maintained.Users with legacy requirements for Yarn v1 under Node.js 26 and above may be able to follow Yarn v1 installation instructions and install using
npm install --global yarn.Governance and Current Members
The Node.js Docker Image is governed by an open maintainer model. See GOVERNANCE.md for project roles and decision-making, and CONTRIBUTING.md for contribution guidance. If a final decision cannot be reached using consensus seeking, the Node.js TSC is the final arbiter.
Docker Maintainers
Collaborators
Collaborators are managed via the @nodejs/docker team.
Emeritus