Skip to content

Commit

Permalink
chore: ubuntu 24.04 base image for test build purposes (#1854)
Browse files Browse the repository at this point in the history
  • Loading branch information
KEGustafsson authored Dec 29, 2024
1 parent 6c0781b commit d7b068e
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/build-base-image-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build Docker base test image

on:
schedule:
- cron: "0 0 * * 1"
workflow_dispatch:

jobs:
build_docker_base_images:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: signalkci
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_PAT }} # Personal access tokens (classic) with a scope of "write:packages" is needed to release ghcr.io package registry.

- name: Build baseimages and push with test tag
uses: docker/build-push-action@v5
with:
file: ./docker/Dockerfile_base_test
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
tags: |
signalk/signalk-server-base:test_
ghcr.io/signalk/signalk-server-base:test_
- name: Modify Dockerfile_rel for testing
run: |
sed -i 's/:latest/:test_/g' ./docker/Dockerfile_rel
- name: Build Signal K test dockers
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile_rel
platforms: linux/amd64,linux/arm/v7,linux/arm64
build-args: |
TAG=latest
- name: Push baseimages to registries with latest tag
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile_base_test
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
tags: |
signalk/signalk-server-base:testing
ghcr.io/signalk/signalk-server-base:testing
28 changes: 28 additions & 0 deletions docker/Dockerfile_base_test
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM ubuntu:24.04

RUN userdel -r ubuntu
RUN groupadd --gid 1000 node \
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node

RUN DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install git python3 build-essential avahi-daemon avahi-discover avahi-utils libnss-mdns mdns-scan libavahi-compat-libdnssd-dev sysstat procps nano curl libcap2-bin sudo dbus bluez\
&& groupadd -r docker -g 991 && groupadd -r i2c -g 990 && groupadd -r spi -g 989 && usermod -a -G dialout,i2c,spi,netdev,docker node

# RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& DEBIAN_FRONTEND=noninteractive apt-get -y install nodejs \
&& npm config rm proxy \
&& npm config rm https-proxy \
&& npm config set fetch-retries 5 \
&& npm config set fetch-retry-mintimeout 60000 \
&& npm config set fetch-retry-maxtimeout 120000 \
&& npm cache clean -f \
&& npm install npm@latest -g \
&& sudo setcap cap_net_raw+eip $(eval readlink -f `which node`)

COPY docker/avahi/avahi-dbus.conf /etc/dbus-1/system.d/avahi-dbus.conf
COPY docker/bluez/bluezuser.conf /etc/dbus-1/system.d/bluezuser.conf
RUN mkdir -p /var/run/dbus/ \
&& chmod -R 777 /var/run/dbus/ \
&& mkdir -p /var/run/avahi-daemon/ \
&& chmod -R 777 /var/run/avahi-daemon/ \
&& chown -R avahi:avahi /var/run/avahi-daemon/

0 comments on commit d7b068e

Please sign in to comment.