Skip to content

Commit

Permalink
add Docker Image for kicad (#353)
Browse files Browse the repository at this point in the history
* add Docker Image for kicad

Signed-off-by: Masaya Kataoka <[email protected]>

* fix composite action

Signed-off-by: Masaya Kataoka <[email protected]>

* update Dockerfile

Signed-off-by: Masaya Kataoka <[email protected]>

* add README

Signed-off-by: Masaya Kataoka <[email protected]>

* update README.md

Signed-off-by: Masaya Kataoka <[email protected]>

* update description

Signed-off-by: Masaya Kataoka <[email protected]>

---------

Signed-off-by: Masaya Kataoka <[email protected]>
  • Loading branch information
hakuturu583 authored Oct 1, 2024
1 parent 083edc1 commit dfd76e7
Show file tree
Hide file tree
Showing 8 changed files with 128 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/docker/kicad/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM linuxserver/kicad:8.0.1

ENV KICAD8_3DMODEL_DIR="/usr/share/kicad/3dmodels/"
ENV KICAD8_FOOTPRINT_DIR="/usr/share/kicad/footprints/"
ENV KICAD8_SYMBOL_DIR="/usr/share/kicad/symbols/"

RUN mkdir kicad_libraries
WORKDIR /kicad_libraries
ADD https://github.com/ncarandini/KiCad-RP-Pico/archive/refs/heads/main.zip KiCad-RP-Pico.zip
RUN unzip KiCad-RP-Pico.zip

RUN cp -r "/kicad_libraries/KiCad-RP-Pico-main/RP-Pico Libraries/Pico.wrl" ${KICAD8_3DMODEL_DIR}
RUN cp -r "/kicad_libraries/KiCad-RP-Pico-main/RP-Pico Libraries/MCU_RaspberryPi_and_Boards.pretty" ${KICAD8_FOOTPRINT_DIR}
RUN cp -r "/kicad_libraries/KiCad-RP-Pico-main/RP-Pico Libraries/MCU_RaspberryPi_and_Boards.kicad_sym" ${KICAD8_SYMBOL_DIR}

WORKDIR /

COPY autostart /defaults/autostart
27 changes: 27 additions & 0 deletions .github/workflows/docker/kicad/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Docker container for OUXT Polaris circuit development

## WHat is it?

This image is based on [this docker image](https://docs.linuxserver.io/images/docker-kicad/).
This image contains kicad library which is necessary for circuit development.
You do not need to install library manually.

## Software versions

KiCAD 8.0.1

## KiCAD Library

- [KiCad-RP-Pico](https://github.com/ncarandini/KiCad-RP-Pico)

## How to use

```bash
git clone https://github.com/OUXT-Polaris/ouxt_automation
cd ouxt_automation/circuits
sh start_kicad.sh
```

Open [http://localhost:3000/](http://localhost:3000/)

![kicad](./kicad.png)
60 changes: 60 additions & 0 deletions .github/workflows/docker/kicad/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: "Build kicad image action"
description: "Build Kicad docker image for circuit development"

inputs:
docker_username:
description: "Username for Dockerhub"
required: true
docker_password:
description: "Password for Dockerhub"
required: true

runs:
using: "composite"
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ inputs.docker_username }}
password: ${{ inputs.docker_password }}
- name: Build and Push Docker Image
if: ${{ github.event_name != 'pull_request'}}
uses: docker/build-push-action@v2
env:
DOCKER_BUILDKIT: 1
with:
username: ${{ inputs.docker_username }}
password: ${{ inputs.docker_password }}
context: ./.github/workflows/docker/kicad
file: ./.github/workflows/docker/kicad/Dockerfile
tags: wamvtan/kicad:latest
no-cache: false
cache-from: type=registry,ref=wamvtan/kicad:buildcache
cache-to: type=registry,ref=wamvtan/kicad:buildcache,mode=max
push: true
- name: Build Docker Image
if: ${{ github.event_name == 'pull_request'}}
uses: docker/build-push-action@v2
env:
DOCKER_BUILDKIT: 1
with:
username: ${{ inputs.docker_username }}
password: ${{ inputs.docker_password }}
context: ./.github/workflows/docker/kicad
file: ./.github/workflows/docker/kicad/Dockerfile
tags: wamvtan/kicad:latest
no-cache: false
cache-from: type=registry,ref=wamvtan/kicad:buildcache
push: false
- uses: peter-evans/dockerhub-description@v3
if: ${{ github.event_name == 'pull_request'}}
with:
username: ${{ inputs.docker_username }}
password: ${{ inputs.docker_password }}
repository: wamvtan/kicad
short-description: "Docker Image for Virtual RobotX Challenge"
readme-filepath: ./.github/workflows/docker/kicad/README.md
enable-url-completion: true
1 change: 1 addition & 0 deletions .github/workflows/docker/kicad/autostart
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kicad
Binary file added .github/workflows/docker/kicad/kicad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions .github/workflows/docker_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,17 @@ jobs:
path: |
ansible/packages.repos
ansible/packages_exact.repos
kicad:
name: build and push wamvtan/kicad
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/actions/cleanup_runner
- uses: ./.github/workflows/docker/kicad
with:
docker_username: ${{ secrets.DOCKER_USERNAME }}
docker_password: ${{ secrets.DOCKER_PASSWORD }}
# wamv:
# needs: export_wamv_repos
# name: build and push wamvtan/wamv
Expand Down
10 changes: 10 additions & 0 deletions circuits/start_kicad.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
docker run \
--rm \
--name=kicad \
--security-opt seccomp=unconfined `#optional` \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Etc/UTC \
-p 3000:3000 \
-p 3001:3001 \
wamvtan/kicad:latest
1 change: 1 addition & 0 deletions docs/docs/tools/docker_images.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ Click on the name of the Docker Image to jump to the Dockerhub details page.
| [wamvtan/l4t_opencv](https://hub.docker.com/r/wamvtan/l4t_opencv) | [Dockerfile](https://github.com/OUXT-Polaris/ouxt_automation/blob/master/.github/workflows/docker/l4t_opencv/Dockerfile) | Docker Image for building opencv for Linux 4 Tegra |
| [wamvtan/yolox](https://hub.docker.com/r/wamvtan/yolox) | [Dockerfile](https://github.com/OUXT-Polaris/ouxt_automation/blob/master/.github/workflows/docker/yolox/Dockerfile) | Docker Images for inferencing yolox. |
| [wamvtan/yolox_trainer](https://hub.docker.com/r/wamvtan/yolox_trainer) | [Dockerfile](https://github.com/OUXT-Polaris/ouxt_automation/blob/master/.github/workflows/docker/yolox_trainer/Dockerfile) | Docker Images for training yolox model. |
| [wamvtan/kicad](https://hub.docker.com/r/wamvtan/kicad) | [Dockerfile](https://github.com/OUXT-Polaris/ouxt_automation/blob/master/.github/workflows/docker/kicad/Dockerfile) | Docker Images for kicad. |

0 comments on commit dfd76e7

Please sign in to comment.