Skip to content

Commit 137e1f2

Browse files
committed
Inital commit
0 parents  commit 137e1f2

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed

README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# KiCad 7 docker
2+
There is no standard way to install and run multiple kicad versions on the same host.
3+
Docker is one way to get around this. The dockerfile is mostly taken from
4+
[devbisme's repo](https://github.com/devbisme/docker_kicad).
5+
6+
# Setup
7+
1. Clone repository
8+
2. Build it
9+
``` bash
10+
docker build \
11+
--build-arg UID=`id -u` \
12+
--build-arg GID=`id -g` \
13+
--build-arg USER_NAME=`id -nu` \
14+
--build-arg HOME=$HOME \
15+
-t kicad7 .
16+
```
17+
18+
# Run it
19+
The following command runs the docker container by forwarding the host's graphics capabilities (assuming
20+
[integrated intel graphics](https://www.reddit.com/r/docker/comments/10dsn6p/how_do_you_pass_amd_gpus_and_intel_gpus_through/) and the host's home folder.
21+
22+
``` bash
23+
docker run --device /dev/dri --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v $HOME:$HOME kicad7"
24+
```
25+
26+
A tip is to add an alias (e.g. alias kicad7=...) for this command in your bash config.
27+
28+
# Note
29+
* In later KiCad versions the standard KiCad library is installed along with KiCad, so it's available under
30+
__/usr/share/kicad__ inside the docker container.
31+
* If KiCad complains about OpenGL support it means GPU is not forwarded properly.
32+
* If the same KiCad version is installed on your host computer, it's going to use the same local
33+
configuration (.config/kicad).
34+
35+
# TODO
36+
* Try to lift this to a later Ubuntu version

dockerfile

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Must use 20.04!
2+
FROM ubuntu:20.04
3+
4+
# These things are needed:
5+
# sudo: So we have /etc/sudoers.d.
6+
# keyboard-configuration: Installation stalls without this.
7+
# software-properties-common: So add-apt-repository exists.
8+
RUN apt-get update && \
9+
apt-get install -y sudo keyboard-configuration software-properties-common
10+
11+
# Install KiCad 7.0.6.
12+
# (Got the version from https://launchpad.net/~kicad/+archive/ubuntu/kicad-7.0-releases.)
13+
RUN add-apt-repository --yes ppa:kicad/kicad-7.0-releases && \
14+
apt-get update && \
15+
apt-get install -y kicad=7.0.6~ubuntu20.04.1
16+
17+
# Replace with your login name, user ID, group ID and HOME from your local host machine
18+
# using the --build-arg option.
19+
ARG UID
20+
ARG GID
21+
ARG USER_NAME
22+
ARG HOME
23+
24+
# Create a user account that mirrors the one on your local host so you can share the X11 socket for the KiCad GUI.
25+
# (See http://fabiorehm.com/blog/2014/09/11/running-gui-apps-with-docker/)
26+
RUN mkdir -p ${HOME} && \
27+
echo "${USER_NAME}:x:${UID}:${GID}:Developer,,,:${HOME}:/bin/bash" >> /etc/passwd && \
28+
echo "${USER_NAME}:x:${UID}:" >> /etc/group && \
29+
echo "${USER_NAME} ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/${USER_NAME} && \
30+
chmod 0440 /etc/sudoers.d/${USER_NAME} && \
31+
chown ${UID}:${GID} -R ${HOME}
32+
33+
USER ${USER_NAME}
34+
35+
# Uncomment one of the entrypoints for whatever app you want to run in the container.
36+
# ENTRYPOINT ["eeschema"]
37+
# ENTRYPOINT ["pcbnew"]
38+
ENTRYPOINT ["kicad"]

0 commit comments

Comments
 (0)