git » sdk » commit 09ae7b1

Add Containerfile for building images containing the SDK build artefacts

author Matthew Wild
2025-04-29 14:16:05 UTC
committer Matthew Wild
2025-04-29 14:46:56 UTC
parent e8d42274c3573b17b65607755c0359486db4720b

Add Containerfile for building images containing the SDK build artefacts

The build is done as part of the container build process, which includes
installing the necessary dependencies.

The final build stage copies the result to a new image, which can be used
downstream in various ways.

build-misc/Containerfile.image +64 -0
build-misc/dmo.sources +6 -0

diff --git a/build-misc/Containerfile.image b/build-misc/Containerfile.image
new file mode 100644
index 0000000..351fa97
--- /dev/null
+++ b/build-misc/Containerfile.image
@@ -0,0 +1,64 @@
+FROM docker.io/debian:testing-slim AS build
+
+WORKDIR /usr/src/snikket-sdk
+
+ARG HAXE_VERSION=4.3.4
+
+RUN apt-get update \
+    && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
+        ca-certificates \
+        gpgv \
+        wget \
+    && rm -rf /var/lib/apt/lists/* \
+    && rm -rf /var/cache/*
+
+RUN wget https://www.deb-multimedia.org/pool/main/d/deb-multimedia-keyring/deb-multimedia-keyring_2024.9.1_all.deb \
+ && (sha256sum deb-multimedia-keyring_2024.9.1_all.deb | grep -q '^8dc6cbb266c701cfe58bd1d2eb9fe2245a1d6341c7110cfbfe3a5a975dcf97ca ') \
+ && dpkg -i deb-multimedia-keyring_2024.9.1_all.deb
+
+COPY build-misc/dmo.sources /etc/apt/sources.list.d/dmo.sources
+
+RUN apt-get update \
+    && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
+        build-essential \
+        git \
+        npm \
+        libdatachannel-dev \
+        libopus-dev \
+        libstrophe-dev \
+        neko \
+    && rm -rf /var/lib/apt/lists/* \
+    && rm -rf /var/cache/*
+
+ADD https://github.com/HaxeFoundation/haxe/releases/download/${HAXE_VERSION}/haxe-${HAXE_VERSION}-linux64.tar.gz /tmp/haxe.tar.gz
+
+RUN mkdir /opt/haxe \
+ && tar xzf /tmp/haxe.tar.gz --strip-components=1 -C /opt/haxe \
+ && mv /opt/haxe/haxe /opt/haxe/haxelib /usr/local/bin
+
+RUN npm install typescript
+
+RUN haxelib setup /opt/haxe
+
+ENV HAXE_STD_PATH=/opt/haxe/std
+
+COPY *.hxml /usr/src/snikket-sdk
+
+COPY . /usr/src/snikket-sdk
+
+RUN make hx-build-dep
+
+RUN cd /opt/haxe/hxcpp/git/tools/hxcpp && haxe compile.hxml
+
+RUN make
+
+RUN haxe test.hxml
+
+FROM docker.io/debian:bookworm-slim
+
+WORKDIR /opt/snikket-sdk
+
+COPY --from=build /usr/src/snikket-sdk/cpp ./cpp
+COPY --from=build /usr/src/snikket-sdk/npm ./npm
+
+CMD ["cp", "-R", "/opt/snikket-sdk", "/output"]
diff --git a/build-misc/dmo.sources b/build-misc/dmo.sources
new file mode 100644
index 0000000..d319b4b
--- /dev/null
+++ b/build-misc/dmo.sources
@@ -0,0 +1,6 @@
+Types: deb
+URIs: https://www.deb-multimedia.org
+Suites: unstable
+Components: main non-free
+Signed-By: /usr/share/keyrings/deb-multimedia-keyring.pgp
+Enabled: yes