There may be a way to install KiCad 7 on linux without losing access to earlier versions, but I don’t know how. So I made a set of docker images for KiCad versions 5, 6, and 7 and stored the build files in branches of this Github repo. Now all I need to do is issue the command kicad5
and I can go back to a simpler time.
I was just putting together my own docker mainly for scripting, I figured it might be useful for others if I dump some notes here about potential changes for the Dockerfile listed by @devbisme along with an except from my Dockerfile.
- In case it’s important for anyone, you can use the latest version of Ubuntu, I think it’s possible that you might need to manually add the GPG key in this case as I’ve done in the snippet below.
- In order to be able to run ‘import pcbnew’ in a python file, you must append to the PYTHONPATH and LD_LIBRARY_PATH as shown in the last two commands of the snippet.
- If you’re having issues with installation commands hanging on user input add the env var DEBIAN_FRONTEND=noninteractive as demonstrated in the snippet.
FROM ubuntu:latest
# RUN apt-get update
RUN apt update
RUN apt install python3 -y
RUN apt install pip -y
RUN apt install wget -y
########################################################################################
### INSTALLING KICAD
# Necessary for having access to add-apt-repository for KiCad
RUN DEBIAN_FRONTEND=noninteractive apt install software-properties-common -y
# Adding the repository for KiCad 7.0 stable release
RUN add-apt-repository --yes ppa:kicad/kicad-7.0-releases
# Changed the keyserver address according to this forum thread advice.
# https://groups.google.com/g/Kurento/c/Q0KE1b8ol_c?pli=1
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 245D5502FAD7A805
# RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 245D5502FAD7A805
# Install KiCad 7.0
RUN apt update
RUN apt install kicad -y
# These changes weren't needed to be manually performed for KiCad 5.1 - not sure why
# they're needed now.
ENV PYTHONPATH=${PYTHONPATH}:/usr/lib/kicad/lib/python3/dist-packages
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib/kicad/lib/x86_64-linux-gnu
########################################################################################
As an add-on to this - if you are setting up a Dockerfile for scripting with development files you copy in and not just for running the GUI, you probably want to add the chown argument to the COPY command (see below). If you don’t you get all kinds of permissions issues because the files moved with COPY are owned by root by default.
COPY --chown=1000:1000 . .
As a word of caution to others - make sure to pin as many versions as possible such as the releases you install with apt (as devbisme has in his repo) otherwise you’ll get non-repeatable behavior. Just spent hours pulling my hair out before realizing there had been a new release that changed the installation method.
@devbisme I’m also now unable to get the pcbnew or eeschema GUI to run without encountering an error (pasted below) and crashing while using ubuntu 22.04. Can you shed any light on the specific issue you ran into that forced you to use 20.04? I’d like to use 22.04 if possible and haven’t located the source of the issue yet or bothered getting into gdb.
Trace/breakpoint trap (core dumped)
Also how’s your performance when running the GUI from a docker container? When I have it running with 20.04 it’s pretty laggy and frustrating to use.
I initially got it running on 20.04 and then encountered an error when I rebuilt for 22.04. I don’t remember what it was.
The Docker version of KiCad 7 runs noticeably slower than the native version w.r.t. things like window resizing and moving part symbols. I don’t know if non-GUI things like DRC show the same effect.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.