forked from yaqwsx/KiKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
44 lines (35 loc) · 1.2 KB
/
Dockerfile
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
FROM ubuntu:20.04 AS base
LABEL maintainer="Jan \"yaqwsx\" Mrázek" \
description="Container for running KiKit applications"
ENV DISPLAY=unix:0.0
RUN export DEBIAN_FRONTEND="noninteractive" && apt-get update && \
apt-get install -y --no-install-recommends \
kicad kicad-libraries zip inkscape make git libmagickwand-dev \
python3 python3-pip python3-wheel python3-setuptools inkscape \
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 \
"Pcbdraw ~= 0.6" \
"numpy ~= 1.20" \
"shapely ~= 1.7" \
"click ~= 7.1" \
"markdown2 ~= 2.4" \
"pybars3 ~= 0.9" \
"solidpython ~= 1.1"
# create a new stage for building and installing KiKit
FROM base AS build
COPY . /src/kikit
WORKDIR /src/kikit
RUN python3 setup.py install
# 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.8/dist-packages \
/usr/local/lib/python3.8/dist-packages
COPY --from=build \
/usr/local/bin \
/usr/local/bin
CMD ["bash"]