| add root layout |
| mount /out from exec sh -c /install amd64 |
| add users and groups |
| apply fs for artifact dhi/pkg-node:24.13.1-alpine3.22@sha256:2ff650a95839827086e647372959da9c7716ca6cd91628181adbde88209a4ddc |
| mkdir /app |
| add metadata |
| ARG NODE_VERSION=24.13.1 |
| RUN |1 NODE_VERSION=24.13.1 /bin/sh -c apk add --no-cache busybox-binsh && apk --no-cache add --virtual .build-deps-fonts msttcorefonts-installer fontconfig && update-ms-fonts && fc-cache -f && apk del .build-deps-fonts && find /usr/share/fonts/truetype/msttcorefonts/ -type l -exec unlink {} \; && apk update && apk upgrade --no-cache && apk add --no-cache git openssh openssl graphicsmagick=1.3.45-r0 `# pinned to avoid ghostscript-fonts (AGPL)` tini tzdata ca-certificates libc6-compat && rm -rf /tmp/* /root/.npm /root/.cache/node /opt/yarn* && apk del apk-tools # buildkit |
| WORKDIR /home/node |
| ENV NODE_PATH=/opt/nodejs/node-v24.13.1/lib/node_modules |
| EXPOSE [5678/tcp] |
| ARG N8N_VERSION=2.9.4 |
| ARG N8N_RELEASE_TYPE=stable |
| ENV NODE_ENV=production |
| ENV N8N_RELEASE_TYPE=stable |
| ENV SHELL=/bin/sh |
| WORKDIR /home/node |
| COPY ./compiled /usr/local/lib/node_modules/n8n # buildkit |
| COPY docker/images/n8n/docker-entrypoint.sh / # buildkit |
| RUN |2 N8N_VERSION=2.9.4 N8N_RELEASE_TYPE=stable /bin/sh -c cd /usr/local/lib/node_modules/n8n && npm rebuild sqlite3 && ln -s /usr/local/lib/node_modules/n8n/bin/n8n /usr/local/bin/n8n && mkdir -p /home/node/.n8n && chown -R node:node /home/node && rm -rf /root/.npm /tmp/* # buildkit |
| EXPOSE [5678/tcp] |
| USER node |
| ENTRYPOINT ["tini" "--" "/docker-entrypoint.sh"] |
| LABEL org.opencontainers.image.title=n8n org.opencontainers.image.description=Workflow Automation Tool org.opencontainers.image.source=https://github.com/n8n-io/n8n org.opencontainers.image.url=https://n8n.io org.opencontainers.image.version=2.9.4 |
| USER root |
| RUN /bin/sh -c mkdir -p /opt/extra # buildkit |
| RUN /bin/sh -c npm --prefix /opt/extra install @langchain/ollama@1.0.3 # buildkit |
| RUN /bin/sh -c cp /opt/extra/node_modules/@langchain/ollama/dist/utils.* $(dirname $(find /usr/local/lib/ -name utils.js | grep ollama)) # buildkit |
| RUN /bin/sh -c chown -R node:node /opt/extra # buildkit |
| USER node |