lumiera_/admin/docker_open-lumiera-buildenv.sh
Ichthyostega 4b29885d51 Docker: setup a Lumiera build environment in a Debian/Ubuntu container
some scripting to help creating a clean build environment for testing and bugfixes

 * build_lumiera-build-dependencies.sh
   All necessary steps to prepare a pristine Debian/Ubuntu/xx distro
   for building Lumiera from source.
   + install the GPG pub key to trust
   + install a Lumiera DEP Repository to get the sources from
   + install build-essential
   + prepare, build and install NoBug
   + prepare, build and install libGDLmm
   + install the Lumiera build-dependencies from the DEB package
   At that point, you should be able to start the build just with `scons`

 * docker_open-lumiera-buildenv.sh
   Additional bash magic to launch a docker container and inject the
   build_lumiera-build-dependencies.sh script into an interactive shell
2019-06-22 19:15:19 +02:00

44 lines
1.2 KiB
Bash
Executable file

#!/bin/sh
#
# docker_open-lumiera-buildenv.sh - launch Docker container with interactive build shell
#
#
#------------------------------------------------------Setup
#
# Working directory path on the host
WORKDIR_HOST="/home/$USER/devel/lumi"
#
# bind-mount of the working dir in the container
WORKDIR_GUEST="/lumi"
#
# Docker image-ID to launch
DOCKER_IMAGE="ubuntu:bionic"
#
# Script code to inject into interactive shell
COMMANDS=$(cat) <<RUN_IN_CONTAINER
. /etc/bash.bashrc
. ~/.bashrc
alias la='ls -latr'
$WORKDIR_GUEST/admin/build_lumiera-build-dependencies.sh
RUN_IN_CONTAINER
#
#------------------------------------------------------Setup(End)
#
# Launch...
# (1) launch the docker container
# (2) start a bash there to process a bash commandline
# (3) this commandline in turn launches an interactive bash
# (4) and this interactive bash gets a startup-Shellscript to perform
# (5) and this shellscript is read from an temporary named pipe to another shellscript
# (6) which in turn prints the script code from the setup-variable $COMMANDS
#
# bash magic thanks to Jonathan Potter; see https://serverfault.com/a/586272
#
#
docker run -v $WORKDIR_HOST:$WORKDIR_GUEST -it $DOCKER_IMAGE bash -c "bash --rcfile <(echo \"${COMMANDS}\" )"