Skip to content

Commit

Permalink
Runner
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto Anic Banic committed Jul 10, 2022
1 parent db5b9d3 commit 2e1d4af
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Docker

on:
push:
branches: [ master ]

jobs:
docker:
name: Publish to Docker Hub
runs-on: self-hosted
steps:
- id: lowercase
name: Generate lowercase
uses: ASzc/change-string-case-action@v2
with:
string: ${{ github.repository }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
tags: ${{ steps.lowercase.outputs.lowercase }}:latest
target: release
push: true
platforms: |
linux/386
linux/amd64
linux/arm/v6
linux/arm/v7
linux/arm64/v8
linux/ppc64le
linux/s390x
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM alpine:latest as builder

RUN apk add --update --no-cache make gcc musl-dev libevent-dev libbsd-dev libjpeg-turbo-dev libgpiod-dev

WORKDIR /usr/src/ustreamer
COPY . .

RUN make WITH_GPIO=1 WITH_PTHREAD_NP=0

FROM alpine:latest as release

RUN apk add --update --no-cache libevent libbsd libjpeg-turbo libgpiod

ARG user=ustreamer
ARG group=ustreamer
ARG uid=2000

RUN adduser --uid=${uid} --disabled-password --gecos="" ${user}

USER ${uid}:${uid}
WORKDIR $HOME

COPY --from=builder /usr/src/ustreamer/ustreamer /usr/local/bin/ustreamer

EXPOSE 8080
ENTRYPOINT ["ustreamer"]
CMD ["--host=0.0.0.0", "--port=8080"]
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: "3"

services:
ustreamer:
image: nicba1010/ustreamer:latest
ports:
- "8080:8080"
devices:
- /dev/video0:/dev/video0

0 comments on commit 2e1d4af

Please sign in to comment.