diff --git a/.github/workflows/docker-image-ki8_full.yml b/.github/workflows/docker-image-ki8_full.yml new file mode 100644 index 0000000..403434d --- /dev/null +++ b/.github/workflows/docker-image-ki8_full.yml @@ -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"}' diff --git a/ki8_full/.gitignore b/ki8_full/.gitignore new file mode 100644 index 0000000..da1235f --- /dev/null +++ b/ki8_full/.gitignore @@ -0,0 +1,2 @@ +kicad_version.py +kicad-7.0-releases.gpg diff --git a/ki8_full/Dockerfile b/ki8_full/Dockerfile new file mode 100644 index 0000000..ab07bbc --- /dev/null +++ b/ki8_full/Dockerfile @@ -0,0 +1,13 @@ +FROM ghcr.io/inti-cmnb/base_os_full:latest_sid +MAINTAINER Salvador E. Tropea +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 diff --git a/ki8_full/build.sh b/ki8_full/build.sh new file mode 100755 index 0000000..0768083 --- /dev/null +++ b/ki8_full/build.sh @@ -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 + diff --git a/ki8_full/kicad_3d_install.sh b/ki8_full/kicad_3d_install.sh new file mode 100755 index 0000000..655bd1c --- /dev/null +++ b/ki8_full/kicad_3d_install.sh @@ -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/* diff --git a/ki8_full/run_kicad_same_user.sh b/ki8_full/run_kicad_same_user.sh new file mode 100755 index 0000000..78328ad --- /dev/null +++ b/ki8_full/run_kicad_same_user.sh @@ -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 diff --git a/ki8_full/run_pcbnew_same_user.sh b/ki8_full/run_pcbnew_same_user.sh new file mode 100755 index 0000000..01b60e8 --- /dev/null +++ b/ki8_full/run_pcbnew_same_user.sh @@ -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 diff --git a/ki8_full/run_shell.sh b/ki8_full/run_shell.sh new file mode 100755 index 0000000..28bc728 --- /dev/null +++ b/ki8_full/run_shell.sh @@ -0,0 +1,2 @@ +#!/bin/sh +docker run --rm -it ghcr.io/inti-cmnb/kicad8_debian:latest_full /bin/bash diff --git a/ki8_full/run_shell_same_user.sh b/ki8_full/run_shell_same_user.sh new file mode 100755 index 0000000..dbf5663 --- /dev/null +++ b/ki8_full/run_shell_same_user.sh @@ -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