docker: Move android into a unified image

This commit is contained in:
Jordan Petridis 2018-11-26 16:23:58 +02:00
parent d17930eabb
commit f085d34a32
No known key found for this signature in database
GPG key ID: 902CC06D159744F5
9 changed files with 71 additions and 93 deletions

View file

@ -1,7 +1,4 @@
stages:
- "build runtime"
- "build base"
# Eventually will replace both of the above stages
- "build docker"
- "preparation"
# Test just one basic build, if succeds procced to test the rest
@ -88,29 +85,18 @@ fedora amd64 docker:
changes:
- 'docker/fedora/*'
ubuntu amd64 run docker:
stage: "build runtime"
# Cross compile image
android 28 amd64 docker:
stage: "build docker"
variables:
ARCH: "amd64"
TAG: "ubuntu-runtime"
CONTEXT_DIR: "docker/runtime-images/"
DOCKERFILE: "docker/runtime-images/Dockerfile-ubuntu"
TAG: "android_28"
CONTEXT_DIR: "docker/android/"
DOCKERFILE: "docker/android/Dockerfile"
extends: .base
only:
changes:
- 'docker/runtime-images/Dockerfile-ubuntu'
ubuntu amd64 build docker:
stage: "build base"
variables:
ARCH: "amd64"
TAG: "ubuntu-build"
CONTEXT_DIR: "docker/build-base-images/"
DOCKERFILE: "docker/build-base-images/Dockerfile-ubuntu"
extends: .base
only:
changes:
- 'docker/build-base-images/Dockerfile-ubuntu'
- 'docker/android/*'
include: "gitlab/ci_template.yml"
@ -120,8 +106,11 @@ build fedora x86_64 local:
stage: 'build'
image: "${CI_REGISTRY_IMAGE}/amd64/fedora:latest"
build ubuntu x86_64 local:
build android 28 local:
extends: '.build'
variables:
MESON_ARGS: "${DEFAULT_MESON_ARGS} -Dlibav=disabled"
image: "${CI_REGISTRY_IMAGE}/amd64/ubuntu-build:latest"
MESON_ARGS: >
-Dbad=enabled
-Dbad:androidmedia=enabled
--cross-file /android_arm64_28.txt
image: "${CI_REGISTRY_IMAGE}/amd64/android_28:latest"

View file

@ -0,0 +1,8 @@
FROM ubuntu:18.04
COPY prepare.sh cleanup.sh android-download-ndk.sh android-create-toolchain.sh /root/
ENV DEBIAN_FRONTEND=noninteractive
RUN sh /root/prepare.sh && \
sh /root/cleanup.sh

View file

@ -19,7 +19,7 @@
# Author: Xavier Claessens <xavier.claessens@collabora.com>
#
set -e
set -eu
arch=$1
api=$2

View file

@ -19,7 +19,7 @@
# Author: Xavier Claessens <xavier.claessens@collabora.com>
#
set -e
set -eu
# Download Android NDK
ANDROID_NDK_VERSION="r18b"

View file

@ -0,0 +1,5 @@
set -eu
echo "Removing apt cache"
rm -R /root/*
rm -R /var/lib/apt/ /var/log/apt/

41
docker/android/prepare.sh Normal file
View file

@ -0,0 +1,41 @@
set -eu
# make source packages available in order to figure out build dependencies
sed -i "s/# deb-src/deb-src/g" /etc/apt/sources.list
apt update
apt build-dep -y \
orc \
gstreamer1.0 \
gst-plugins-base1.0 \
gst-plugins-good1.0 \
gst-plugins-bad1.0 \
gst-plugins-ugly1.0 \
gst-libav1.0 \
gst-rtsp-server1.0 \
gst-python1.0 \
gstreamer-vaapi \
gstreamer-editing-services1.0
apt install -y \
ccache \
gdb \
git \
xvfb \
python3-pip \
wget \
unzip
pip3 install meson
# Configure git for various usage
git config --global user.email "gst-build@gstreamer.net"
git config --global user.name "Gstbuild Runner"
# Setup Android toolchain
./root/android-download-ndk.sh
./root/android-create-toolchain.sh arm64 28
# get gst-build and make all subprojects available
git clone git://anongit.freedesktop.org/gstreamer/gst-build '/gst-build/'
cd '/gst-build/' && meson build/ && rm -rf build/

View file

@ -1,45 +0,0 @@
FROM registry.freedesktop.org/gstreamer/gst-ci/amd64/ubuntu-runtime
# make source packages available in order to figure out build dependencies
RUN \
sed -i "s/# deb-src/deb-src/g" /etc/apt/sources.list && \
apt-get update && \
apt-get -y build-dep \
orc \
gstreamer1.0 \
gst-plugins-base1.0 \
gst-plugins-good1.0 \
gst-plugins-bad1.0 \
gst-plugins-ugly1.0 \
gst-libav1.0 \
gst-rtsp-server1.0 \
gst-python1.0 \
gstreamer-vaapi \
gstreamer-editing-services1.0 && \
apt-get -y install \
ccache \
gdb \
git \
xvfb \
python3-pip \
wget \
unzip
RUN pip3 install meson
ENV GST_BUILD_PATH="/gst-build/"
# Configure git for various usage
RUN git config --global user.email "gst-build@gstreamer.net" && git config --global user.name "Gstbuild Runner"
# Setup Android toolchain
COPY android-download-ndk.sh .
COPY android-create-toolchain.sh .
RUN ./android-download-ndk.sh
RUN ./android-create-toolchain.sh arm64 28
RUN rm -rf /android-ndk
# get gst-build and make all subprojects available
RUN git clone git://anongit.freedesktop.org/gstreamer/gst-build $GST_BUILD_PATH && \
cd $GST_BUILD_PATH && \
meson build/ && rm -rf build/

View file

@ -1,22 +0,0 @@
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND=noninteractive
# upgrade and install all runtime dependencies for gstreamer
RUN apt-get update && \
apt-get -y upgrade && \
apt-get -y install --no-install-recommends\
gstreamer1.0-libav \
gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-bad-faad \
gstreamer1.0-plugins-bad-videoparsers \
gstreamer1.0-plugins-ugly \
gstreamer1.0-plugins-ugly-amr \
gstreamer1.0-rtsp \
gstreamer1.0-alsa \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-pulseaudio \
gstreamer1.0-x \
libgstreamer-plugins-base1.0-0 \
libgstreamer1.0

View file

@ -83,3 +83,5 @@ build android arm64 api28:
-Dbad=enabled
-Dbad:androidmedia=enabled
--cross-file /android_arm64_28.txt
before_script:
- cat /android_arm64_28.txt