gstreamer/docker/cerbero/Dockerfile-fedora
Jordan Petridis a99cdc8909 docker: allow to specify the branch to pull for various repos
Declare an docker build-arg [1] and use it
whenever cloning one of our repositories. If the buildarg
is not specified, the variable defaults back to 'master'
and thus the current behavior doesn't change.

From the .gitlab-ci.yml file, when building pass
the GST_UPSTREAM_BRANCH that's defined from the ci_template
as the buildarg so we will be building the corresponding branches
for the docker images.

Close #33

[1] https://docs.docker.com/engine/reference/builder/#arg
2020-03-08 18:53:23 +00:00

40 lines
2.2 KiB
Text

FROM registry.fedoraproject.org/fedora:31
ENV TERM="dumb"
ARG DEFAULT_BRANCH="master"
# System setup
RUN echo "fastestmirror=true" >> /etc/dnf/dnf.conf && \
dnf upgrade -y && \
dnf install -y sudo git lbzip2 rsync wine
# Configure git for various usage
RUN git config --global user.email "cerbero@gstreamer.freedesktop.org" && \
git config --global user.name "Cerbero Build System"
RUN git clone -b ${DEFAULT_BRANCH} https://gitlab.freedesktop.org/gstreamer/cerbero.git && \
mkdir $HOME/.cerbero && \
echo "allow_parallel_build=True" > $HOME/.cerbero/cerbero.cbc && \
echo "use_ccache=True" >> $HOME/.cerbero/cerbero.cbc && \
cd cerbero && \
echo "local_sources=\"/cerbero/cerbero-sources\"" >> localconf.cbc && \
echo "home_dir=\"/cerbero/cerbero-build\"" >> localconf.cbc && \
./cerbero-uninstalled -t -c localconf.cbc bootstrap -y --system-only && \
./cerbero-uninstalled -t -c localconf.cbc fetch-bootstrap && \
./cerbero-uninstalled -t -c localconf.cbc fetch-package gstreamer-1.0 && \
./cerbero-uninstalled -t -c localconf.cbc -c config/cross-win32.cbc fetch-bootstrap && \
./cerbero-uninstalled -t -c localconf.cbc -c config/cross-win32.cbc fetch-package gstreamer-1.0 && \
./cerbero-uninstalled -t -c localconf.cbc -c config/cross-win32.cbc bootstrap -y --system-only && \
./cerbero-uninstalled -t -c localconf.cbc -c config/cross-win64.cbc fetch-bootstrap && \
./cerbero-uninstalled -t -c localconf.cbc -c config/cross-win64.cbc fetch-package gstreamer-1.0 && \
./cerbero-uninstalled -t -c localconf.cbc -c config/cross-win64.cbc bootstrap -y --system-only && \
./cerbero-uninstalled -t -c localconf.cbc -c config/cross-android-universal.cbc fetch-bootstrap && \
./cerbero-uninstalled -t -c localconf.cbc -c config/cross-android-universal.cbc fetch-package gstreamer-1.0 && \
./cerbero-uninstalled -t -c localconf.cbc -c config/cross-android-universal.cbc bootstrap -y --system-only && \
cd .. && \
rm /cerbero/cerbero-sources/android-ndk-*.zip && \
rm /cerbero/cerbero-sources/mingw-*.tar.xz && \
rm -rf /cerbero/cerbero-build/{dist,logs,sources} && \
rm -f /cerbero/cerbero-build/{linux,windows,android}*.cache && \
dnf clean all