Describe the problem/error/question
I’m trying to run n8n via docker and my flow requires python and community lib. I tried to run several times and there was always error which is mainly about apk. Honestly, I’m low code person so it is mainly gemini code. But here is how my Dockerfile looks like
FROM n8nio/n8n:latest
USER root
RUN apk add --update --no-cache
python3
py3-pip
build-base
python3-dev
libffi-dev
libxml2-dev
libxslt-dev
RUN python3 -m venv /opt/venv
ENV PATH=“/opt/venv/bin:$PATH”
RUN pip install --no-cache-dir
pdfplumber
python-docx
openpyxl
pandas
USER node
And here is my yml file
services:
n8n:
build: .
container_name: n8n-mine
restart: always
ports:
- “5678:5678”
environment: - N8N_SECURE_COOKIE=false
- EXECUTIONS_DATA_PRUNE=true
- EXECUTIONS_DATA_MAX_AGE=168
- GENERIC_TIMEZONE=Asia/Bangkok
- TZ=Asia/Bangkok
- N8N_BLOCK_FS_READ_ACCESS=false
- N8N_BLOCK_FS_WRITE_ACCESS=false
- N8N_RESTRICT_FILE_ACCESS_TO=/files
volumes: - n8n_data:/home/node/.n8n
- ./files:/files
volumes:
n8n_data:
The error code is below
I will really appreciate any suggestions. Thanks!
What is the error message (if any)?
=> ERROR [2/4] RUN apk add --update --no-cache python3 py3-pip build-base python3-dev libffi 0.1s
------
> [2/4] RUN apk add --update --no-cache python3 py3-pip build-base python3-dev libffi-dev libxml2-dev libxslt-dev:
0.130 /bin/sh: apk: not found
------
[+] up 0/1
⠙ Image n8n-sertis-n8n Building 1.8s
Dockerfile:3
--------------------
2 | USER root
3 | >>> RUN apk add --update --no-cache \
4 | >>> python3 \
5 | >>> py3-pip \
6 | >>> build-base \
7 | >>> python3-dev \
8 | >>> libffi-dev \
9 | >>> libxml2-dev \
10 | >>> libxslt-dev
11 | RUN python3 -m venv /opt/venv
--------------------
failed to solve: process “/bin/sh -c apk add --update --no-cache python3 py3-pip build-base python3-dev libffi-dev libxml2-dev libxslt-dev” did not complete successfully: exit code: 127
Information on your n8n setup
- n8n version:
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
- Operating system: macos