changes build process + readme
This commit is contained in:
31
Dockerfile
31
Dockerfile
@@ -1,22 +1,26 @@
|
|||||||
FROM debian:bookworm
|
FROM debian:trixie AS builder
|
||||||
|
COPY build.sh .
|
||||||
COPY start.sh .
|
RUN apt-get update && \
|
||||||
RUN export DEBIAN_FRONTEND=noninteractive && \
|
|
||||||
apt-get update && \
|
|
||||||
apt-get upgrade -y -q && \
|
apt-get upgrade -y -q && \
|
||||||
apt-get install -y wget curl sudo gpg apt-transport-https lsb-release && \
|
chmod +x build.sh && \
|
||||||
wget -qO /tmp/hyperion.pub.key https://releases.hyperion-project.org/hyperion.pub.key && \
|
bash build.sh
|
||||||
gpg --dearmor -o /usr/share/keyrings/hyperion.pub.gpg /tmp/hyperion.pub.key && \
|
|
||||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hyperion.pub.gpg] https://apt.releases.hyperion-project.org/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/hyperion.list && \
|
|
||||||
apt-get update && \
|
FROM debian:trixie
|
||||||
apt-get install -y hyperion && \
|
COPY start.sh .
|
||||||
|
COPY --from=builder /usr/bin/hyperiond /usr/bin/hyperiond
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get upgrade -y -q && \
|
||||||
|
apt-get install -y sudo tzdata libfontconfig1 libglib-2.0 libproxy1v5 libcec-dev && \
|
||||||
|
chmod 755 /usr/bin/hyperiond && \
|
||||||
groupadd -f hyperion && \
|
groupadd -f hyperion && \
|
||||||
useradd -r -s /bin/bash -g hyperion hyperion && \
|
useradd -r -s /bin/bash -g hyperion hyperion && \
|
||||||
chmod 777 /start.sh && \
|
chmod 777 /start.sh && \
|
||||||
mkdir /config && \
|
mkdir /config && \
|
||||||
|
chmod 777 /config && \
|
||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
rm -rf /var/cache/apk/*
|
rm -rf /var/cache/apk/* && \
|
||||||
|
rm -rf /usr/share/man
|
||||||
|
|
||||||
# Flatbuffers Server port
|
# Flatbuffers Server port
|
||||||
EXPOSE 19400
|
EXPOSE 19400
|
||||||
@@ -42,3 +46,4 @@ ENV GID=1000
|
|||||||
|
|
||||||
SHELL ["/bin/bash", "-c"]
|
SHELL ["/bin/bash", "-c"]
|
||||||
ENTRYPOINT bash start.sh uid="$UID" gid="$GID"
|
ENTRYPOINT bash start.sh uid="$UID" gid="$GID"
|
||||||
|
#ENTRYPOINT tail -f /dev/null
|
||||||
|
|||||||
24
README.md
24
README.md
@@ -1,30 +1,24 @@
|
|||||||
# hyperion-docker
|
# hyperion-docker
|
||||||
|
|
||||||
This repository is based on the work of [psychowood](https://github.com/psychowood/hyperion.ng-docker) although it has suffered some modifications.
|
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
This is a simple repository containining some the source files that enable you tu run [hyperiong.ng](https://github.com/hyperion-project/hyperion.ng/#readme) in a docker container.
|
This is a simple repository containing the source files that enable you tu run [hyperiong.ng](https://github.com/hyperion-project/hyperion.ng/#readme) in a docker container.
|
||||||
You can choose between building the image yourself or using the image that's published in this repositoru.
|
You can choose between building the image yourself or using the image that's published in this repository.
|
||||||
|
|
||||||
The image is quite simple:
|
This repository initially was based on the work of [psychowood](https://github.com/psychowood/hyperion.ng-docker).
|
||||||
|
Upon putting further thought into it seemed necesasary to use a custom build instead of the official deb packages.
|
||||||
|
|
||||||
1. It's based on the [official Debian 12 (bookworm) docker image](https://hub.docker.com/_/debian)
|
|
||||||
2. It downloads the hyperion official package from the [official hyperion apt package repository](https://apt.releases.hyperion-project.org/)
|
The image has the following characteristics:
|
||||||
|
|
||||||
|
1. It's based on the [official Debian 13 (trixie) docker image](https://hub.docker.com/_/debian)
|
||||||
|
2. It includes a custom build of hyperion designed to take away uncecesarry dependencies
|
||||||
3. Maps the `/config` dirctory as an external volume, to keep your settings
|
3. Maps the `/config` dirctory as an external volume, to keep your settings
|
||||||
4. Runs hyperiond service as non-root user. Default UID:GID are 1000:1000 but they can be easily changed through environment variables
|
4. Runs hyperiond service as non-root user. Default UID:GID are 1000:1000 but they can be easily changed through environment variables
|
||||||
|
|
||||||
Sadly, the resulting image is not exaclty slim at ~500MB, because hyperion has lots of dependencies. Since many of them are for the Desktop/Qt UI, it should be possible to slim the image up by cherry picking the ones not used but the cli service, but that's probably not really worth it.
|
|
||||||
|
|
||||||
On the other hand, the running service does not need lots of RAM (on my system takes ~64MB without the cache).
|
|
||||||
|
|
||||||
You have different options to run this image, after starting the container you can reach the web ui going either to http://youdockerhost:8090 or https://youdockerhost:8092
|
|
||||||
|
|
||||||
### Standard configuration
|
### Standard configuration
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
start the container with `docker compose up -d` with the following `docker-compose.yml` :
|
start the container with `docker compose up -d` with the following `docker-compose.yml` :
|
||||||
```yaml
|
```yaml
|
||||||
version: '3.3'
|
version: '3.3'
|
||||||
|
|||||||
32
build.sh
Normal file
32
build.sh
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
BUILD_DEPENDENCIES="git nano cmake ninja-build devscripts build-essential lintian python3 python3-dev python3-pip python3-jsonschema python3-jinja2 qt6-base-dev qt6-serialport-dev qt6-websockets-dev libudev-dev libxkbcommon-dev libvulkan-dev libgl1-mesa-dev libusb-1.0-0-dev libasound2-dev libturbojpeg0-dev libjpeg-dev libssl-dev pkg-config libftdi1-dev libcec-dev libp8-platform-dev libudev-dev libdrm-dev libxcb-randr0-dev libxcb-shm0-dev libxcb-image0-dev libx11-dev libxrandr-dev libxrender-dev libxcb-util0-dev libxcb-render0-dev"
|
||||||
|
HYPERION_RELEASE_TAG="2.1.1"
|
||||||
|
HYPERION_GIT_REPO_URL="https://github.com/hyperion-project/hyperion.ng.git"
|
||||||
|
BUILD_TYPE="Release"
|
||||||
|
ARCHITECTURE="amd64"
|
||||||
|
BUILD_PLATFORM=""
|
||||||
|
CODE_DIR="/source"
|
||||||
|
BUILD_DIR="/build"
|
||||||
|
BIN_DIR="/usr/bin/hyperiond"
|
||||||
|
BUILD_ARGS=""
|
||||||
|
|
||||||
|
# determine platform cmake parameter
|
||||||
|
if [[ ! -z "$BUILD_PLATFORM" ]]; then
|
||||||
|
PLATFORM="-DPLATFORM=${BUILD_PLATFORM}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Installing build dependencies"
|
||||||
|
apt-get install -y -q $BUILD_DEPENDENCIES
|
||||||
|
pip install jsonschema
|
||||||
|
|
||||||
|
echo "Cloning source code from Hyperion repository with ${HYPERION_RELEASE_TAG} tag"
|
||||||
|
git clone --depth 1 --recurse-submodules -q --branch ${HYPERION_RELEASE_TAG} ${HYPERION_GIT_REPO_URL} ${CODE_DIR}
|
||||||
|
|
||||||
|
mkdir -p ${BUILD_DIR}
|
||||||
|
echo "Compiling application"
|
||||||
|
cmake -S ${CODE_DIR} -B ${BUILD_DIR} -G Ninja -DCMAKE_INSTALL_PREFIX=${BIN_DIR} -DENABLE_QT=OFF -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${PLATFORM} ${BUILD_ARGS}
|
||||||
|
cd ${BUILD_DIR}
|
||||||
|
cmake --build .
|
||||||
|
cmake --build . --target install/strip
|
||||||
|
#remove desktop components
|
||||||
|
rm -rf /usr/bin/hyperiond/share/hyperion/desktop
|
||||||
2
start.sh
2
start.sh
@@ -12,4 +12,4 @@ done
|
|||||||
groupmod -g $gid hyperion
|
groupmod -g $gid hyperion
|
||||||
usermod -u $uid hyperion
|
usermod -u $uid hyperion
|
||||||
chown -R hyperion:hyperion /config
|
chown -R hyperion:hyperion /config
|
||||||
sudo -u hyperion /usr/bin/hyperiond -i --userdata /config
|
sudo -u hyperion /usr/bin/hyperiond/bin/hyperiond -i --userdata /config
|
||||||
Reference in New Issue
Block a user