Skip to content

Commit

Permalink
docker: add dockerfiles for ubuntu + use github actions to build for …
Browse files Browse the repository at this point in the history
…docker hub
  • Loading branch information
aureliendavid committed Dec 4, 2023
1 parent 5455674 commit 9a7070e
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ga.yml
@@ -0,0 +1,35 @@
name: GitHub Actions
run-name: build with docker
on: [push]

jobs:
master-build-and-deploy:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' }}
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: build image
run: docker build -t gpac-ubuntu -f build/docker/ubuntu.Dockerfile .
- name: check docker images
run: docker image list
- name: check docker run
run: docker run gpac-ubuntu || true
- name: login docker hub
run: docker login --username gpac --password ${{secrets.DOCKER_HUB_TOKEN}}
- name: tag docker image
run: docker tag gpac-ubuntu gpac/ubuntu:latest
- name: push docker image
run: docker push gpac/ubuntu:latest


other-builds:
runs-on: ubuntu-latest
if: ${{ github.ref != 'refs/heads/master' || github.event_name != 'push' }}
steps:
- name: Check out code
uses: actions/checkout@v3
- name: build image
run: docker build -t gpac-ubuntu -f build/docker/ubuntu.Dockerfile .
18 changes: 18 additions & 0 deletions build/docker/ubuntu-deps.Dockerfile
@@ -0,0 +1,18 @@
FROM ubuntu:latest


# set up the machine
RUN apt-get -yqq update && apt-get install -y --no-install-recommends build-essential pkg-config g++ git cmake yasm fakeroot dpkg-dev devscripts debhelper ccache
RUN apt-get install -y --no-install-recommends zlib1g-dev libfreetype6-dev libjpeg62-dev libpng-dev libmad0-dev libfaad-dev libogg-dev libvorbis-dev libtheora-dev liba52-0.7.4-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libavdevice-dev libnghttp2-dev libopenjp2-7-dev libcaca-dev libxv-dev x11proto-video-dev libgl1-mesa-dev libglu1-mesa-dev x11proto-gl-dev libxvidcore-dev libssl-dev libjack-jackd2-dev libasound2-dev libpulse-dev libsdl2-dev dvb-apps mesa-utils
RUN apt-get autoremove -y && apt-get clean -y


WORKDIR /gpac-deps

# get manually built dependencies
RUN git clone --depth=1 https://github.com/gpac/deps_unix
WORKDIR /gpac-deps/deps_unix
RUN git submodule update --init --recursive --force --checkout
RUN ./build_all.sh linux

CMD ["bash"]
30 changes: 30 additions & 0 deletions build/docker/ubuntu.Dockerfile
@@ -0,0 +1,30 @@
FROM gpac/ubuntu-deps:latest


WORKDIR /gpac

# get code
COPY . gpac_public

# get manually built dependencies to the main folder
RUN bash -c "[[ -e /gpac-deps/gpac_public/extra_lib ]] && cp -av /gpac-deps/gpac_public/extra_lib/* /gpac/gpac_public/extra_lib/ && rm -rf /gpac-deps/gpac_public/extra_lib/*"



WORKDIR /gpac/gpac_public

# static build
RUN make distclean && ./configure --static-bin && make -j
RUN rm -rf /gpac/binaries && mkdir -p /gpac/binaries && cp -vf bin/gcc/* /gpac/binaries/ || true


# deb package
RUN rm -f *.deb && make distclean && make deb
RUN mv -v *.deb /gpac/binaries/


#install
RUN dpkg -i /gpac/binaries/*.deb


CMD ["gpac"]

0 comments on commit 9a7070e

Please sign in to comment.