{"id":13443029,"url":"https://github.com/nodejs/docker-node","last_synced_at":"2025-05-10T01:25:09.443Z","repository":{"id":24522936,"uuid":"27929056","full_name":"nodejs/docker-node","owner":"nodejs","description":"Official Docker Image for Node.js :whale: :turtle: :rocket: ","archived":false,"fork":false,"pushed_at":"2025-05-08T21:38:40.000Z","size":2248,"stargazers_count":8401,"open_issues_count":147,"forks_count":1974,"subscribers_count":168,"default_branch":"main","last_synced_at":"2025-05-09T01:16:11.838Z","etag":null,"topics":["docker","docker-image","docker-node","dockerfile","node","nodejs"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/_/node/","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nodejs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":"GOVERNANCE.md","roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"nodejs","open_collective":"nodejs"}},"created_at":"2014-12-12T16:48:48.000Z","updated_at":"2025-05-08T21:38:42.000Z","dependencies_parsed_at":"2024-01-18T18:06:52.214Z","dependency_job_id":"df20df3e-2035-4c80-995a-d8cadde2de99","html_url":"https://github.com/nodejs/docker-node","commit_stats":{"total_commits":1147,"total_committers":131,"mean_commits":8.755725190839694,"dds":0.7768090671316478,"last_synced_commit":"7b8f9738ed3ddf103e331e402ee474fb53af7a27"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodejs%2Fdocker-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodejs%2Fdocker-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodejs%2Fdocker-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodejs%2Fdocker-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nodejs","download_url":"https://codeload.github.com/nodejs/docker-node/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253348488,"owners_count":21894545,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-image","docker-node","dockerfile","node","nodejs"],"created_at":"2024-07-31T03:01:55.047Z","updated_at":"2025-05-10T01:25:09.374Z","avatar_url":"https://github.com/nodejs.png","language":"Dockerfile","readme":"# Node.js\n\n[![dockeri.co](https://dockerico.blankenship.io/image/node)](https://hub.docker.com/_/node)\n\n[![GitHub issues](https://img.shields.io/github/issues/nodejs/docker-node.svg \"GitHub issues\")](https://github.com/nodejs/docker-node)\n[![GitHub stars](https://img.shields.io/github/stars/nodejs/docker-node.svg \"GitHub stars\")](https://github.com/nodejs/docker-node)\n\nThe official Node.js docker image, made with love by the node community.\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n## Table of Contents\n\n- [What is Node.js?](#what-is-nodejs)\n- [How to use this image](#how-to-use-this-image)\n  - [Create a `Dockerfile` in your Node.js app project](#create-a-dockerfile-in-your-nodejs-app-project)\n  - [Best Practices](#best-practices)\n  - [Run a single Node.js script](#run-a-single-nodejs-script)\n  - [Verbosity](#verbosity)\n    - [Dockerfile](#dockerfile)\n    - [Docker Run](#docker-run)\n    - [NPM run](#npm-run)\n- [Image Variants](#image-variants)\n  - [`node:\u003cversion\u003e`](#nodeversion)\n  - [`node:alpine`](#nodealpine)\n  - [`node:bullseye`](#nodebullseye)\n  - [`node:bookworm`](#nodebookworm)\n  - [`node:slim`](#nodeslim)\n- [License](#license)\n- [Supported Docker versions](#supported-docker-versions)\n- [Supported Node.js versions](#supported-nodejs-versions)\n- [Governance and Current Members](#governance-and-current-members)\n  - [Docker Working Group Members](#docker-working-group-members)\n  - [Docker Working Group Collaborators](#docker-working-group-collaborators)\n  - [Emeritus](#emeritus)\n    - [Docker Working Group Members](#docker-working-group-members-1)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## What is Node.js?\n\nNode.js is a platform built on Chrome's JavaScript runtime for easily building\nfast, scalable network applications. Node.js uses an event-driven, non-blocking\nI/O model that makes it lightweight and efficient, perfect for data-intensive\nreal-time applications that run across distributed devices.\n\nSee: http://nodejs.org\n\n## How to use this image\n\n### Create a `Dockerfile` in your Node.js app project\n\n```dockerfile\n# specify the node base image with your desired version node:\u003cversion\u003e\nFROM node:16\n# replace this with your application's default port\nEXPOSE 8888\n```\n\nYou can then build and run the Docker image:\n\n```console\n$ docker build -t my-nodejs-app .\n$ docker run -it --rm --name my-running-app my-nodejs-app\n```\n\nIf you prefer Docker Compose:\n\n```yml\nversion: \"2\"\nservices:\n  node:\n    image: \"node:8\"\n    user: \"node\"\n    working_dir: /home/node/app\n    environment:\n      - NODE_ENV=production\n    volumes:\n      - ./:/home/node/app\n    expose:\n      - \"8081\"\n    ports: # use if it is necessary to expose the container to the host machine\n      - \"8001:8001\"\n    command: \"npm start\"\n```\n\nYou can then run using Docker Compose:\n\n```console\n$ docker-compose up -d\n```\n\nDocker Compose example mounts your current directory (including node_modules) to the container.\nIt assumes that your application has a file named [`package.json`](https://docs.npmjs.com/files/package.json)\ndefining [start script](https://docs.npmjs.com/misc/scripts#default-values).\n\n### Best Practices\n\nWe have assembled a [Best Practices Guide](./docs/BestPractices.md) for those using these images on a daily basis.\n\n### Run a single Node.js script\n\nFor many simple, single file projects, you may find it inconvenient to write a\ncomplete `Dockerfile`. In such cases, you can run a Node.js script by using the\nNode.js Docker image directly:\n\n```console\n$ docker run -it --rm --name my-running-script -v \"$PWD\":/usr/src/app -w /usr/src/app node:8 node your-daemon-or-script.js\n```\n\n### Verbosity\n\nPrior to 8.7.0 and 6.11.4, the docker images overrode the default npm log\nlevel from `warn` to `info`. However, due to improvements to npm and new Docker\npatterns (e.g. multi-stage builds) the working group reached a [consensus](https://github.com/nodejs/docker-node/issues/528)\nto revert the log level to npm defaults. If you need more verbose output, please\nuse one of the following methods to change the verbosity level.\n\n#### Dockerfile\n\nIf you create your own `Dockerfile` which inherits from the `node` image, you can\nsimply use `ENV` to override `NPM_CONFIG_LOGLEVEL`.\n\n```dockerfile\nFROM node\nENV NPM_CONFIG_LOGLEVEL info\n...\n```\n\n#### Docker Run\n\nIf you run the node image using `docker run`, you can use the `-e` flag to\noverride `NPM_CONFIG_LOGLEVEL`.\n\n```console\n$ docker run -e NPM_CONFIG_LOGLEVEL=info node ...\n```\n\n#### NPM run\n\nIf you are running npm commands, you can use `--loglevel` to control the\nverbosity of the output.\n\n```console\n$ docker run node npm --loglevel=warn ...\n```\n\n## Image Variants\n\nThe `node` images come in many flavors, each designed for a specific use case.\nAll of the images contain pre-installed versions of `node`,\n[`npm`](https://www.npmjs.com/), and [`yarn`](https://yarnpkg.com). For each\nsupported architecture, the supported variants are different. In the file:\n[versions.json](./versions.json), it lists all supported variants for all of\nthe architectures that we support now.\n\n### `node:\u003cversion\u003e`\n\nThis is the defacto image. If you are unsure about what your needs are, you\nprobably want to use this one. It is designed to be used both as a throw away\ncontainer (mount your source code and start the container to start your app), as\nwell as the base to build other images off of. This tag is based off of\n[`buildpack-deps`](https://registry.hub.docker.com/_/buildpack-deps/).\n`buildpack-deps` is designed for the average user of docker who has many images\non their system. It, by design, has a large number of extremely common Debian\npackages. This reduces the number of packages that images that derive from it\nneed to install, thus reducing the overall size of all images on your system.\n\n### `node:alpine`\n\nThis image is based on the popular\n[Alpine Linux project](http://alpinelinux.org), available in\n[the `alpine` official image](https://hub.docker.com/_/alpine). Alpine Linux is\nmuch smaller than most distribution base images (~5MB), and thus leads to much\nslimmer images in general.\n\nThis variant is highly recommended when final image size being as small as\npossible is desired. The main caveat to note is that it does use\n[musl libc](http://www.musl-libc.org) instead of\n[glibc and friends](http://www.etalabs.net/compare_libcs.html), so certain\nsoftware might run into issues depending on the depth of their libc\nrequirements. However, most software doesn't have an issue with this, so this\nvariant is usually a very safe choice. See\n[this Hacker News comment thread](https://news.ycombinator.com/item?id=10782897)\nfor more discussion of the issues that might arise and some pro/con comparisons\nof using Alpine-based images.\n\nOne common issue that may arise is a missing shared library required for use of\n`process.dlopen`. To add the missing shared libraries to your image:\n\n- For Alpine v3.18 and earlier, adding the\n[`libc6-compat`](https://pkgs.alpinelinux.org/package/v3.18/main/x86/libc6-compat)\npackage in your Dockerfile is recommended: `apk add --no-cache libc6-compat`\n\n- Starting from Alpine v3.19, you can use the\n[`gcompat`](https://pkgs.alpinelinux.org/package/v3.19/main/x86/gcompat) package\nto add the missing shared libraries: `apk add --no-cache gcompat`\n\nTo minimize image size, it's uncommon for additional related tools\n(such as `git` or `bash`) to be included in Alpine-based images. Using this\nimage as a base, add the things you need in your own Dockerfile\n(see the [`alpine` image description](https://hub.docker.com/_/alpine/) for\nexamples of how to install packages if you are unfamiliar).\n\nTo make the image size even smaller, you can [bundle without npm/yarn](./docs/BestPractices.md#smaller-images-without-npmyarn).\n\n### `node:bullseye`\n\nThis image is based on version 11 of\n[Debian](http://debian.org), available in\n[the `debian` official image](https://hub.docker.com/_/debian).\n\n### `node:bookworm`\n\nThis image is based on version 12 of\n[Debian](http://debian.org), available in\n[the `debian` official image](https://hub.docker.com/_/debian).\n\n### `node:slim`\n\nThis image does not contain the common packages contained in the default tag and\nonly contains the minimal packages needed to run `node`. Unless you are working\nin an environment where *only* the Node.js image will be deployed and you have\nspace constraints, we highly recommend using the default image of this\nrepository.\n\n## License\n\n[License information](https://github.com/nodejs/node/blob/master/LICENSE) for\nthe software contained in this image. [License information](LICENSE) for the\nNode.js Docker project.\n\n## Supported Docker versions\n\nThis image is officially supported on Docker version 1.9.1.\n\nSupport for older versions (down to 1.6) is provided on a best-effort basis.\n\nPlease see [the Docker installation\ndocumentation](https://docs.docker.com/installation/) for details on how to\nupgrade your Docker daemon.\n\n## Supported Node.js versions\n\nThis project will support Node.js versions as still under active support as per the [Node.js release schedule](https://github.com/nodejs/Release).\n\n## Governance and Current Members\n\nThe Node.js Docker Image is governed by the Docker Working Group. See\n[GOVERNANCE.md](GOVERNANCE.md)\nto learn more about the group's structure and [CONTRIBUTING.md](CONTRIBUTING.md) for guidance\nabout the expectations for all contributors to this project.\n\n### Docker Working Group Members\n\n- Hans Kristian Flaatten ([starefossen](https://github.com/starefossen))\n- Hugues Malphettes ([hmalphettes](https://github.com/hmalphettes))\n- John Mitchell ([jlmitch5](https://github.com/jlmitch5))\n\n### Docker Working Group Collaborators\n\n- Mikeal Rogers ([mikeal](https://github.com/mikeal))\n- Laurent Goderre ([LaurentGoderre](https://github.com/LaurentGoderre))\n- Simen Bekkhus ([SimenB](https://github.com/SimenB))\n- Peter Dave Hello ([PeterDaveHello](https://github.com/PeterDaveHello))\n\n### Emeritus\n\n#### Docker Working Group Members\n\n- Christopher Horrell ([chorrell](https://github.com/chorrell))\n- Peter Petrov ([pesho](https://github.com/pesho))\n","funding_links":["https://github.com/sponsors/nodejs","https://opencollective.com/nodejs"],"categories":["Dockerfile","HarmonyOS","nodejs","NodeJS Related :zap: :zap: :zap:","docker"],"sub_categories":["Windows Manager","Docker Nodejs"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodejs%2Fdocker-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnodejs%2Fdocker-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodejs%2Fdocker-node/lists"}