-
-
Notifications
You must be signed in to change notification settings - Fork 245
Expand file tree
/
Copy pathDockerfile
More file actions
60 lines (48 loc) · 1.89 KB
/
Dockerfile
File metadata and controls
60 lines (48 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
ARG REPO=ubuntu
FROM $REPO:24.04 AS base
ARG KICAD_VERSION="10.0"
ARG ADDITIONAL_PACKAGES
ARG ADDITIONAL_PYTHON_PACKAGES
LABEL maintainer="Jan \"yaqwsx\" Mrázek" \
description="Container for running KiKit applications"
RUN apt-get update && \
apt-get install -y software-properties-common $ADDITIONAL_PACKAGES && \
rm -rf /var/lib/apt/lists/*
RUN add-apt-repository --yes ppa:kicad/kicad-$KICAD_VERSION-releases
# Setup ENV variables for KiCAD 9 & 10
# See https://gitlab.com/kicad/packaging/kicad-ubuntu-builder/kicad-daily-package/-/issues/43
ENV PYTHONPATH=/usr/lib/kicad/lib/python3/dist-packages:${PYTHONPATH} \
LD_LIBRARY_PATH=/usr/lib/kicad/lib/x86_64-linux-gnu/:${LD_LIBRARY_PATH}
RUN export DEBIAN_FRONTEND="noninteractive" && apt-get -qq update && \
apt-get -qq install -y --no-install-recommends \
kicad kicad-libraries zip inkscape make git libmagickwand-dev \
python3 $ADDITIONAL_PYTHON_PACKAGES python3-pip python3-wheel \
python3-setuptools python3-dev build-essential \
libgraphicsmagick1-dev libmagickcore-dev openscad && \
rm -rf /var/lib/apt/lists/*
# hack: manually install Python dependencies to speed up the build process
# for repetitive builds
RUN pip3 install --break-system-packages \
"numpy" \
"shapely >= 2.0.3" \
"click >= 7.1" \
"markdown2 >= 2.4" \
"pybars3 >= 0.9" \
"solidpython >= 1.1.2" \
"commentjson >= 0.9"
# create a new stage for building and installing KiKit
FROM base AS build
COPY . /src/kikit
WORKDIR /src/kikit
RUN pip3 install --break-system-packages .
# the final stage only takes the installed packages from dist-packages
# and ignores the src directories
FROM base
COPY --from=build \
/usr/local/lib/python3.12/dist-packages \
/usr/local/lib/python3.12/dist-packages
COPY --from=build \
/usr/local/bin \
/usr/local/bin
ENTRYPOINT [ "/usr/local/bin/kikit" ]
WORKDIR "/kikit"