{"id":13526234,"url":"https://github.com/mhart/alpine-node","last_synced_at":"2025-09-28T19:32:14.231Z","repository":{"id":30026105,"uuid":"33575005","full_name":"mhart/alpine-node","owner":"mhart","description":"Minimal Node.js Docker Images built on Alpine Linux","archived":true,"fork":false,"pushed_at":"2023-01-15T21:19:40.000Z","size":416,"stargazers_count":2454,"open_issues_count":10,"forks_count":303,"subscribers_count":49,"default_branch":"master","last_synced_at":"2024-09-27T02:45:48.398Z","etag":null,"topics":["alpine","docker","nodejs"],"latest_commit_sha":null,"homepage":"","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/mhart.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"mhart"}},"created_at":"2015-04-08T00:11:50.000Z","updated_at":"2024-09-24T08:46:52.000Z","dependencies_parsed_at":"2023-01-16T21:45:10.976Z","dependency_job_id":null,"html_url":"https://github.com/mhart/alpine-node","commit_stats":null,"previous_names":[],"tags_count":1229,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhart%2Falpine-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhart%2Falpine-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhart%2Falpine-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhart%2Falpine-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mhart","download_url":"https://codeload.github.com/mhart/alpine-node/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234556004,"owners_count":18851885,"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":["alpine","docker","nodejs"],"created_at":"2024-08-01T06:01:26.727Z","updated_at":"2025-09-28T19:32:13.878Z","avatar_url":"https://github.com/mhart.png","language":"Dockerfile","readme":"# Deprecated\n\nThis project is now in archive mode. Please use the official Node.js Alpine images at:\n\nhttps://github.com/nodejs/docker-node#nodealpine\n\nMinimal Node.js Docker Images\n-----------------------------\n\nVersions v16.4.2, v14.17.3, v12.22.3, v10.24.1, v8.17.0, v6.17.1, v4.9.1, v0.12.18 and v0.10.48 –\nbuilt on [Alpine Linux](https://alpinelinux.org/).\n\nAll versions use the one [mhart/alpine-node](https://hub.docker.com/r/mhart/alpine-node/) repository,\nbut each version aligns with the following tags (ie, `mhart/alpine-node:\u003ctag\u003e`). The sizes are for the\n*unpacked* images as reported by Docker – compressed sizes are about 1/3 of these:\n\n- Full install built with npm and yarn:\n  - `latest`, `16`, `16.4`, `16.4.2` – 108 MB (npm 7.19.1, yarn 1.22.10)\n  - `14`, `14.17`, `14.17.3` – 109 MB (npm 6.14.13, yarn 1.22.10)\n  - `12`, `12.22`, `12.22.3` – 80.4 MB (npm 6.14.13, yarn 1.22.10)\n  - `10`, `10.24`, `10.24.1` – 73.1 MB (npm 6.14.12, yarn 1.22.10)\n  - `8`, `8.17`, `8.17.0` – 67.8 MB (npm 6.14.11, yarn 1.22.10)\n- Full install build with npm:\n  - `6`, `6.17`, `6.17.1` – 49 MB (npm 3.10.10)\n  - `4`, `4.9`, `4.9.1` – 35.2 MB (npm 2.15.12)\n  - `0.12`, `0.12.18` – 32.4 MB (npm 2.15.12)\n  - `0.10`, `0.10.48` – 27.8 MB (npm 2.15.12)\n- Slim install with no npm or yarn:\n  - `slim`, `slim-16`, `slim-16.4`, `slim-16.4.2` – 78.1 MB\n  - `slim-14`, `slim-14.17`, `slim-14.17.3` – 73.9 MB\n  - `slim-12`, `slim-12.22`, `slim-12.22.3` – 46.9 MB\n  - `slim-10`, `slim-10.24`, `slim-10.24.1` – 41.3 MB\n  - `slim-8`, `slim-8.17`, `slim-8.17.0` – 37.2 MB\n  - `slim-6`, `slim-6.17`, `slim-6.17.1` – 32.5 MB\n\nExamples\n--------\n\n```console\n$ docker run --rm mhart/alpine-node:14 node --version\nv14.17.3\n\n$ docker run --rm mhart/alpine-node:12 node --version\nv12.22.3\n\n$ docker run --rm mhart/alpine-node:14 npm --version\n6.14.13\n\n$ docker run --rm mhart/alpine-node:14 yarn --version\n1.22.10\n\n$ docker run --rm mhart/alpine-node:slim-14 node --version\nv14.17.3\n\n$ docker run --rm mhart/alpine-node:slim-12 node --version\nv12.22.3\n```\n\nExample Dockerfile for your own Node.js project\n-----------------------------------------------\n\nIf you're doing your `npm install`/`npm ci` or `yarn install` from your\n`Dockerfile`, then you'll probably want to add `node_modules` to your\n`.dockerignore` file first, so that it doesn't get sent to the docker daemon.\n\nFor the smallest builds, use a multi-stage build – where you install your\nmodules using the full install image, but then create your app using the slim\nimage – this can reduce the size of your final image by ~35MB or so.\n\n```Dockerfile\n# This stage installs our modules\nFROM mhart/alpine-node:12\nWORKDIR /app\nCOPY package.json package-lock.json ./\n\n# If you have native dependencies, you'll need extra tools\n# RUN apk add --no-cache make gcc g++ python3\n\nRUN npm ci --prod\n\n# Then we copy over the modules from above onto a `slim` image\nFROM mhart/alpine-node:slim-12\n\n# If possible, run your container using `docker run --init`\n# Otherwise, you can use `tini`:\n# RUN apk add --no-cache tini\n# ENTRYPOINT [\"/sbin/tini\", \"--\"]\n\nWORKDIR /app\nCOPY --from=0 /app .\nCOPY . .\nCMD [\"node\", \"index.js\"]\n```\n\nIf you can't do multi-stage builds, then you can just do everything on a \"full\ninstall\" image:\n\n```Dockerfile\nFROM mhart/alpine-node:12\n\n# If possible, run your container using `docker run --init`\n# Otherwise, you can use `tini`:\n# RUN apk add --no-cache tini\n# ENTRYPOINT [\"/sbin/tini\", \"--\"]\n\nWORKDIR /app\nCOPY . .\n\n# If you have native dependencies, you'll need extra tools\n# RUN apk add --no-cache make gcc g++ python3\n\nRUN npm ci --prod\n\nCMD [\"node\", \"index.js\"]\n```\n\nCaveats\n-------\n\nAs Alpine Linux uses musl, you may run into some issues with environments\nexpecting glibc-like behavior – especially if you try to use binaries compiled\nwith glibc. You should recompile these binaries to use musl (compiling on\nAlpine is probably the easiest way to do this).\n\nIf you get an error similar to `error loading shared library\nld-linux-x86-64.so.2`, it may be that you have dependencies relying on libc –\nyou can try to fix this by adding `RUN apk add --no-cache libc6-compat` or\n`RUN ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2` to your\n`Dockerfile`.\n\nInspired by:\n\n- https://github.com/alpinelinux/aports/blob/454db196/main/nodejs/APKBUILD\n- https://github.com/alpinelinux/aports/blob/454db196/main/libuv/APKBUILD\n- https://hub.docker.com/r/ficusio/nodejs-base/~/dockerfile/\n","funding_links":["https://github.com/sponsors/mhart"],"categories":["HarmonyOS","Dockerfile","docker","nodejs"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhart%2Falpine-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmhart%2Falpine-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhart%2Falpine-node/lists"}