Skip to content

Commit a689958

Browse files
committed
fix Dockerfile to build and install executable
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
1 parent df32ff3 commit a689958

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Dockerfile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,20 @@ FROM python:3.11 AS builder
44
WORKDIR /build
55
COPY . .
66

7-
RUN pip install .
7+
RUN apt-get update && apt-get install -y --no-install-recommends \
8+
build-essential gcc python3-dev pkg-config && \
9+
rm -rf /var/lib/apt/lists/* && \
10+
pip install --upgrade pip setuptools wheel build
811

9-
RUN python3 setup.py sdist && \
10-
pip install dist/*.tar.gz --target /install
12+
RUN python -m build && \
13+
pip install dist/*.tar.gz --prefix=/install
1114

12-
# minimal runtime image
15+
# runtime stage
1316
FROM python:3.11-slim AS runtime
1417

15-
COPY --from=builder /install /usr/local/lib/python3.11/site-packages
18+
# copy installed Python libs + CLI scripts
19+
COPY --from=builder /install /usr/local
20+
1621
COPY etc/*.json etc/*.yaml /etc/villas/controller/
1722
COPY villas-controller.service /etc/systemd/system/
1823

0 commit comments

Comments
 (0)