Skip to content

Commit

Permalink
Added KiCad 8 Full using Sid
Browse files Browse the repository at this point in the history
  • Loading branch information
set-soft committed Mar 19, 2024
1 parent 524078f commit b44fc92
Show file tree
Hide file tree
Showing 9 changed files with 115 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/docker-image-ki8_full.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: KiCad 8 Full Docker image

on:
push:
tags:
- ki8f_*
repository_dispatch:
types: [build_k8f]

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
permissions:
packages: write
contents: read

steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
run: |
cd ki8_full
./build.sh
- name: Trigger KiCad-Auto image build
run: |
curl -X POST -u "${{secrets.PAT_USERNAME}}:${{secrets.PAT_TOKEN}}" -H "Accept: application/vnd.github.v3+json" -H "Content-Type: application/json" https://api.github.com/repos/INTI-CMNB/kicad_auto_test/dispatches --data '{"event_type": "build_k8p"}'
2 changes: 2 additions & 0 deletions ki8_full/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
kicad_version.py
kicad-7.0-releases.gpg
13 changes: 13 additions & 0 deletions ki8_full/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM ghcr.io/inti-cmnb/base_os_full:latest_sid
MAINTAINER Salvador E. Tropea <stropea@inti.gob.ar>
LABEL Description="KiCad 8 on Debian + heavy tools (experimental)"
LABEL org.opencontainers.image.description "KiCad 8 on Debian + heavy tools (experimental)"

ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
COPY kicad_3d_install.sh kicad_version.py /usr/bin/
RUN apt-get -y update && \
apt-get install -y --no-install-recommends kicad kicad-footprints kicad-symbols kicad-templates && \
apt-get -y autoremove && \
rm -rf /var/lib/apt/lists/* /var/cache/debconf/templates.dat-old /var/lib/dpkg/status-old && \
rm -rf /usr/share/icons/Adwaita/ /*.deb
13 changes: 13 additions & 0 deletions ki8_full/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
set -e
cp ../kicad_version.py .
docker build -f Dockerfile -t ghcr.io/inti-cmnb/kicad8_debian:latest_full .
TG1=`docker run --rm ghcr.io/inti-cmnb/kicad8_debian:latest_full kicad_version.py`
TG2=d_sid
TG3=b`docker run --rm ghcr.io/inti-cmnb/kicad8_debian:latest_full /bin/bash -c "blender --version | head -n 1 | tr -d 'Blender '"`
docker tag ghcr.io/inti-cmnb/kicad8_debian:latest_full ghcr.io/inti-cmnb/kicad_debian:ki${TG1}_Debian_full
docker tag ghcr.io/inti-cmnb/kicad8_debian:latest_full ghcr.io/inti-cmnb/kicad8_debian:${TG1}_${TG2}_${TG3}
docker push ghcr.io/inti-cmnb/kicad_debian:ki${TG1}_Debian_full
docker push ghcr.io/inti-cmnb/kicad8_debian:${TG1}_${TG2}_${TG3}
docker push ghcr.io/inti-cmnb/kicad8_debian:latest_full

4 changes: 4 additions & 0 deletions ki8_full/kicad_3d_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
apt-get -y update
apt-get -y install --no-install-recommends kicad-packages3d
rm -rf /var/lib/apt/lists/*
13 changes: 13 additions & 0 deletions ki8_full/run_kicad_same_user.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
export USER_ID=$(id -u)
export GROUP_ID=$(id -g)
docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY \
--user $USER_ID:$GROUP_ID \
--env NO_AT_BRIDGE=1 \
--workdir="/home/$USER" \
--volume="/etc/group:/etc/group:ro" \
--volume="/home/$USER:/home/$USER:rw" \
--volume="/etc/passwd:/etc/passwd:ro" \
--volume="/etc/shadow:/etc/shadow:ro" \
--volume="/home/$USER:/home/$USER:rw" \
ghcr.io/inti-cmnb/kicad8_debian:latest_full kicad
13 changes: 13 additions & 0 deletions ki8_full/run_pcbnew_same_user.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
export USER_ID=$(id -u)
export GROUP_ID=$(id -g)
docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY \
--user $USER_ID:$GROUP_ID \
--env NO_AT_BRIDGE=1 \
--workdir="/home/$USER" \
--volume="/etc/group:/etc/group:ro" \
--volume="/home/$USER:/home/$USER:rw" \
--volume="/etc/passwd:/etc/passwd:ro" \
--volume="/etc/shadow:/etc/shadow:ro" \
--volume="/home/$USER:/home/$USER:rw" \
ghcr.io/inti-cmnb/kicad8_debian:latest_full pcbnew
2 changes: 2 additions & 0 deletions ki8_full/run_shell.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
docker run --rm -it ghcr.io/inti-cmnb/kicad8_debian:latest_full /bin/bash
13 changes: 13 additions & 0 deletions ki8_full/run_shell_same_user.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
export USER_ID=$(id -u)
export GROUP_ID=$(id -g)
docker run --rm -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY \
--user $USER_ID:$GROUP_ID \
--env NO_AT_BRIDGE=1 \
--workdir="/home/$USER" \
--volume="/etc/group:/etc/group:ro" \
--volume="/home/$USER:/home/$USER:rw" \
--volume="/etc/passwd:/etc/passwd:ro" \
--volume="/etc/shadow:/etc/shadow:ro" \
--volume="/home/$USER:/home/$USER:rw" \
ghcr.io/inti-cmnb/kicad8_debian:latest_full /bin/bash

0 comments on commit b44fc92

Please sign in to comment.