diff --git a/.github/workflows/docker-alpine-image.yaml b/.github/workflows/docker-alpine-image.yaml index 3a91e0c..9fb9fcd 100644 --- a/.github/workflows/docker-alpine-image.yaml +++ b/.github/workflows/docker-alpine-image.yaml @@ -3,6 +3,7 @@ name: Build Alpine on: push: branches: [master] + tags: [v*] pull_request: branches: [master] @@ -13,6 +14,15 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - + name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: pikvm/ustreamer + tags: | + type=ref,event=tag + type=sha,format=long - name: Set up QEMU uses: docker/setup-qemu-action@v2 @@ -21,5 +31,41 @@ jobs: uses: docker/setup-buildx-action@v2 with: driver-opts: image=moby/buildkit:master - - name: Build - run: docker buildx build --file pkg/docker/Dockerfile.alpine --platform linux/arm64,linux/amd64,linux/arm/v7 . + - + name: Build and export to Docker + uses: docker/build-push-action@v3 + with: + context: . + load: true + tags: ustreamer + file: pkg/docker/Dockerfile.alpine + - + name: Test + run: | + echo version: $(docker run --rm -t ustreamer --version) + echo -e "features:\n$(docker run --rm -t ustreamer --features)" + - + name: Build multi arch + uses: docker/build-push-action@v3 + with: + context: . + platforms: linux/arm64,linux/amd64,linux/arm/v7 + file: pkg/docker/Dockerfile.alpine + - + name: Login to DockerHub + if: startsWith(github.ref, 'refs/tags/v') + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Push + if: startsWith(github.ref, 'refs/tags/v') + uses: docker/build-push-action@v3 + with: + context: . + platforms: linux/arm64,linux/amd64,linux/arm/v7 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + file: pkg/docker/Dockerfile.alpine diff --git a/README.md b/README.md index 8a844b6..06f008f 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,36 @@ $ ./ustreamer \ You can always view the full list of options with ```ustreamer --help```. +# Docker (Raspberry Pi 4 HDMI) +## Preparations + +Add following lines to /boot/firmware/usercfg.txt: +``` +gpu_mem=128 +dtoverlay=tc358743 +``` +Check size of CMA: +```bash +$ dmesg | grep cma-reserved +[ 0.000000] Memory: 7700524K/8244224K available (11772K kernel code, 1278K rwdata, 4320K rodata, 4096K init, 1077K bss, 281556K reserved, 262144K cma-reserved) +``` +If it is smaller than 128M add following to /boot/firmware/cmdline.txt: +``` +cma=128M +``` +Save changes and reboot. +## Launch +Set HDMI EDID (it is not saved between reboots): +```bash +$ wget https://raw.githubusercontent.com/pikvm/kvmd/master/configs/kvmd/tc358743-edid.hex +$ sudo v4l2-ctl --device=/dev//dev/video0 --set-edid=file=tc358743-edid.hex --fix-edid-checksums --info-edid +``` +Start container: +```bash +$ docker run --device /dev/video0:/dev/video0 -p 8080:8080 pikvm/ustreamer:latest +``` +Then access the web interface at port 8080 (e.g. http://raspberrypi.local:8080). + ----- # Raspberry Pi Camera Example Example usage for the Raspberry Pi v1 camera: