diff --git a/.dockerignore b/.dockerignore index 6862ac0..3744e44 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,5 @@ -.cache -.vscode -build/ +** + +!cmake/ +!src/ +!CMakeLists.txt diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a7db6ac..5a5401b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -48,7 +48,7 @@ jobs: uses: docker/build-push-action@v6 with: labels: ${{ steps.meta.outputs.labels }} - platforms: linux/amd64, linux/arm/v7, linux/arm64 + platforms: linux/amd64, linux/arm64 push: true tags: ${{ steps.meta.outputs.tags }} target: run diff --git a/Dockerfile b/Dockerfile index de5ca3f..9053fe5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:latest as build -RUN apk add --no-cache --virtual .build-deps-base \ +RUN apk add --no-cache \ clang \ cmake \ cppzmq \ @@ -8,40 +8,40 @@ RUN apk add --no-cache --virtual .build-deps-base \ make \ pkgconf -ENV CC=clang -ENV CXX=clang++ +ENV CC="clang" +ENV CXX="clang++" ENV CFLAGS="-O3" ENV CXXFLAGS="-O3" ENV MAKEFLAGS="-j$(nproc)" -RUN mkdir -p /build -WORKDIR /build +RUN mkdir -p /opt/lmz +WORKDIR /opt/lmz -RUN git clone --depth 1 https://github.com/Knifa/rpi-rgb-led-matrix.git -WORKDIR /build/rpi-rgb-led-matrix -RUN cd lib \ +RUN git clone --depth 1 https://github.com/knifa/rpi-rgb-led-matrix.git \ + && cd rpi-rgb-led-matrix/lib \ && make -RUN mkdir -p /build/led-matrix-zmq-server -WORKDIR /build/led-matrix-zmq-server -ADD . . +RUN mkdir -p /opt/lmz/led-matrix-zmq-server +WORKDIR /opt/lmz/led-matrix-zmq-server +COPY . . RUN mkdir -p build \ && cd build \ - && cmake -DRPI_RGB_LED_MATRIX_DIR=/build/rpi-rgb-led-matrix .. \ + && cmake -DRPI_RGB_LED_MATRIX_DIR=/opt/lmz/rpi-rgb-led-matrix .. \ && make + FROM alpine:latest as run RUN apk add --no-cache \ libc++ \ libzmq -RUN mkdir -p /opt/led-matrix-zmq-server -WORKDIR /opt/led-matrix-zmq-server +RUN mkdir -p /opt/lmz +WORKDIR /opt/lmz/ COPY --from=build \ - /build/led-matrix-zmq-server/build/led-matrix-zmq-* \ + /opt/lmz/led-matrix-zmq-server/build/led-matrix-zmq-* \ ./ -ENV PATH="/opt/led-matrix-zmq-server:$PATH" +ENV PATH="/opt/lmz:$PATH" CMD ["echo", "Please run a specific led-matrix-zmq binary!"] diff --git a/README.md b/README.md index a257437..8678b3e 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,9 @@ A tool for interacting with [rpi-rgb-led-matrix](https://github.com/hzeller/rpi- ## Docker -[A Docker image is available](https://github.com/Knifa/led-matrix-zmq-server/pkgs/container/led-matrix-zmq-server). +A [Docker image](https://github.com/Knifa/led-matrix-zmq-server/pkgs/container/led-matrix-zmq-server) is available for `amd64` and `arm64`. -The server must be run with `--privileged` to allow GPIO access. +The server must be run with `--privileged` to allow GPIO access. This binary is only included in the `arm64` image. ```shell docker run \ @@ -61,6 +61,10 @@ sudo ./led-matrix-zmq-server \ # ...etc ``` +#### Endpoints + +The `--xyz-endpoint` options pass directly through to ZeroMQ, so you can use any valid transport string. For example, you could specify `tcp://0.0.0.0:42069` to listen on the network. + ### Sending Frames The server is a simple ZMQ REQ-REP loop. All you need to do is send your frame as a big ol' byte chunk then wait for an empty message back. Each frame should be in a RGBA32 format.