Skip to content

Commit

Permalink
First attempt at building arm64 docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
jp-bennett committed Nov 14, 2024
1 parent a53a963 commit 2a44519
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
26 changes: 25 additions & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on: workflow_dispatch

jobs:

build:
build-x64:

runs-on: ubuntu-22.04

Expand All @@ -22,3 +22,27 @@ jobs:
context: ./x64
push: true
tags: meshtastic/github-action-runner:latest

build-arm64:

runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
name: Set up QEMU

- name: Docker login
run: docker login -u meshtastic -p ${{secrets.DOCKER_TOKEN}}

- name: Docker setup
uses: docker/setup-buildx-action@v3
platforms: linux/arm64

- name: Docker build and push
uses: docker/build-push-action@v6
platforms: linux/arm64
with:
context: ./arm64
push: true
tags: meshtastic/github-action-runner:latest
27 changes: 27 additions & 0 deletions arm64/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM debian:bookworm
MAINTAINER Jonathan Bennett
SHELL ["/bin/bash", "-c"]
RUN <<EOF
useradd ubuntu -m -s /bin/bash
usermod -a -G sudo ubuntu
apt update
apt upgrade -y
apt install curl pip git python3-venv pkg-config libicu-dev sudo podman zip jq wget -y
sed -i /etc/sudoers -re 's/^%sudo.*/%sudo ALL=(ALL:ALL) NOPASSWD: ALL/g'
ln -s /usr/bin/podman /usr/bin/docker
EOF

WORKDIR /home/ubuntu
USER ubuntu

RUN <<EOF
cd /home/ubuntu
mkdir runner
latest_runner_version=$(curl -I -v -s https://github.com/actions/runner/releases/latest 2>&1 | perl -ne 'next unless s/^< location: //; s{.*/v}{}; s/\s+//; print')
curl -sL "https://github.com/actions/runner/releases/download/v${latest_runner_version}/actions-runner-linux-arm64-${latest_runner_version}.tar.gz" | tar xzvC ./runner/
sudo ./runner/bin/installdependencies.sh
python3 -m venv ./
source ./bin/activate
pip install -U platformio adafruit-nrfutil
pip install -U meshtastic --pre
EOF

0 comments on commit 2a44519

Please sign in to comment.