Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker: add dockerfiles for ubuntu + use github actions to build for …
…docker hub
- Loading branch information
1 parent
5455674
commit 9a7070e
Showing
3 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] |