-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
support for building inside docker #5630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| .git | ||
| .github | ||
| .vscode | ||
| .devcontainer | ||
| *.log | ||
| *.tmp |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| FROM ubuntu:latest | ||
|
|
||
| RUN apt-get update \ | ||
| && apt-get install -y --no-install-recommends nodejs npm git ca-certificates python3-pip \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
Comment on lines
+3
to
+5
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Verify Dockerfile uses venv-based Python deps and no system-break flags.
rg -n 'break-system-packages|ignore-installed|python3-venv|python3 -m venv|ENV PATH="/opt/venv/bin:\$PATH"' DockerfileRepository: wled/WLED Length of output: 135 Avoid system-level pip override flags; install Python deps in a venv instead.
Proposed fix RUN apt-get update \
- && apt-get install -y --no-install-recommends nodejs npm git ca-certificates python3-pip \
+ && apt-get install -y --no-install-recommends nodejs npm git ca-certificates python3-pip python3-venv \
&& rm -rf /var/lib/apt/lists/*
@@
RUN npm ci
-RUN pip install --break-system-packages --ignore-installed -r requirements.txt
+RUN python3 -m venv /opt/venv \
+ && /opt/venv/bin/pip install --no-cache-dir -r requirements.txt
+ENV PATH="/opt/venv/bin:$PATH"🤖 Prompt for AI Agents |
||
|
|
||
| WORKDIR /workdir | ||
|
|
||
| COPY . . | ||
|
|
||
| RUN npm ci || npm install | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
| RUN pip install --break-system-packages --ignore-installed -r requirements.txt | ||
|
|
||
| ENV WLED_RELEASE=True | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is Its not checked by platformio or pio-scripts, neither referenced anywhere in our nightly CI jobs. SO maybe just remove it, to avoid future problems.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will remove it then. This was suggested in the intially drafted Dockerfile in the Discord conversation, I just copypasted it. |
||
|
|
||
| CMD ["bash"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| services: | ||
| wled-build: | ||
| image: wled-build | ||
| build: . | ||
| volumes: | ||
| - ./build_output:/workdir/build_output | ||
| command: ["bash", "-c", "npm run build && pio run -e $PIO_ENV"] | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pin the base image to a specific version.
Using
ubuntu:latestleads to non-reproducible builds because the underlying image can change at any time. For a containerized build environment, reproducibility is essential.🔒 Proposed fix to pin Ubuntu version
📝 Committable suggestion
🧰 Tools
🪛 Trivy (0.69.3)
[error] 1-1: Image user should not be 'root'
Specify at least 1 USER command in Dockerfile with non-root user as argument
Rule: DS-0002
Learn more
(IaC/Dockerfile)
[error] 1-1: Image user should not be 'root'
Specify at least 1 USER command in Dockerfile with non-root user as argument
Rule: DS-0002
Learn more
(IaC/Dockerfile)
🤖 Prompt for AI Agents