Skip to content
Snippets Groups Projects
Commit f8d51796 authored by Sebastian Fricke's avatar Sebastian Fricke
Browse files

Add a Dockerfile


Provides a container based on debian-testing, that contains all of the
necessary dependencies and pre-compiled tools.

Signed-off-by: default avatarSebastian Fricke <sebastian.fricke@collabora.com>
parent 888eedb7
No related branches found
No related tags found
No related merge requests found
FROM debian:testing-slim
ARG DEBIAN_FRONTEND=noninteractive
# Install build tools
RUN apt-get update && apt-get install -y --no-install-recommends git make texinfo bison flex \
gettext dwarves meson python3-sphinx-rtd-theme libudev-dev pkg-config clang doxygen clang \
emscripten llvm
# Install required libraries
RUN apt-get install -y --no-install-recommends gcc-multilib g++-multilib libgmp-dev \
libmpfr-dev libmpc-dev libssl-dev libelf-dev libsqlite3-dev libasound2-dev libjpeg-dev \
libjson-c-dev libqt5opengl5-dev libsdl2-dev libbpf-dev libgtk-3-dev libc++-dev libc++1 \
libc++abi-dev libc++abi1 libclang-dev libclang1 liblldb-dev libllvm-ocaml-dev libomp-dev libomp5
# Install additional utilities
RUN apt-get install -y --no-install-recommends dvipng rsync wget clang-tidy clang-tools clangd \
xz-utils clang-format python3-argcomplete bc python3-clang lld lldb abi-dumper abi-compliance-checker
# Install packages required for virtualization
RUN apt-get install -y --no-install-recommends qemu-system-x86 virtme-ng
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Move .git/refs/heads/master into the container in order to read the git hash of the current version of the build-scripts
COPY ./cross.sh ./funcs.sh ./prepare_build.sh ./build.sh ./configs ./gitmenu.sh ./pahole*\
./prepare_kernel.sh ./upload.sh ./virtme-test.sh parselog.pl .git/refs/heads/master /build-scripts/
RUN git config --global --add safe.directory /build-scripts/media-git
WORKDIR /build-scripts
......@@ -74,6 +74,17 @@ you need to.
Once all the setup steps are performed you can start to use the
build.sh script to test your patches.
Using a container environment
-----------------------------
This project provides a Dockerfile to ease sourcing the dependencies for the different tools, to avoid clashes with your system dependencies and to enable installation on unsupported OS variations.
With the provided `container.sh` script you can create and interact with the container.
To build the container simply execute: `./container.sh build` and to run the container use the image tag of the container and execute: `./container.sh run <image-tag>`.
The container will clone local kernel sources into the project under the folder `media-git` and will bind that folder into the container.
In order to provide a custom `.env.sh` file, you have to fill out the example under `custom_data/env.sh`.
Within the container you will have to execute `./build.sh setup` to prepare the repository before you can run tests as described below.
Using build.sh
--------------
......
......@@ -204,8 +204,10 @@ fi
if [ "$1" == "setup" ]; then
if [ ! -d $build_data/media-git ]; then
echo '`media-git` folder missing, run prepare_build.sh first'
exit 1
$top/prepare_kernel.sh
fi
if [ ! -d $build_data/smatch || ! -d $build_data/v4l-utils || ! -d $build_data/edid-decode ]; then
$top/prepare_build.sh
fi
mkdir -p $build_data/trees
cd $build_data/trees
......
#!/bin/bash
IMAGE_TAG="$(date +"%Y-%m-%d")_media_build"
case "$1" in
run)
if [ ! "$2" ]; then
echo "Usage: $0 run IMAGE_TAG"
exit 1
fi
mkdir -p build-data cross logs
podman run -it \
--mount type=bind,source="$(pwd)"/custom_data/env.sh,destination=/build-scripts/env.sh,readonly \
--mount type=bind,source="$(pwd)"/build-data,destination=/build-scripts/build-data \
--mount type=bind,source="$(pwd)"/cross,destination=/build-scripts/cross \
--mount type=bind,source="$(pwd)"/logs,destination=/build-scripts/logs \
"$2" \
/bin/bash
;;
build)
mkdir -p custom_data
cat > custom_data/env.sh << EOF
myrepo=git://linuxtv.org/hverkuil/media_tree.git
name="Example Name"
email="example@mail.com"
EOF
if [ ! -d build-data/media-git ]; then
./prepare_kernel.sh
fi
podman build -t $IMAGE_TAG --progress=plain . 2>&1 | tee build.log
;;
*)
echo "Usage: $0 {run IMAGE_TAG|build}"
exit 1
esac
myrepo=git://linuxtv.org/hverkuil/media_tree.git
name="Example Name"
email="example@mail.com"
......@@ -3,11 +3,6 @@
cd build-data
git clone git://linuxtv.org/v4l-utils.git
git clone git://linuxtv.org/edid-decode.git
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git media-git
if [ ! -d smatch ]; then
git clone git://repo.or.cz/smatch.git
fi
cd build-data/media-git
git remote add media_tree git://linuxtv.org/media_tree.git
git remote add media_stage git://linuxtv.org/media_stage.git
cd ../..
!#/bin/bash
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git build-data/media-git
cd build-data/media-git
git remote add media_tree git://linuxtv.org/media_tree.git
git remote add media_stage git://linuxtv.org/media_stage.git
cd ../..
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment