tests/tools/Docker/create_docker_container.sh
author Edouard Tisserant <edouard@beremiz.fr>
Wed, 13 Nov 2024 14:42:34 +0100
changeset 4049 80fc760d4a4a
parent 3694 129b8e32f5bb
permissions -rwxr-xr-x
Modbus: allows modbus thread stack size customization with MODBUS_STACK_SIZE macro.

For example, add "-DMODBUS_STACK_SIZE=0x2000" to target CFLAGS to limit stack size to 128kB
#!/bin/bash

set -e

# source directory containing beremiz, matiec, etc..
SRCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd ../../../.. && pwd )"
echo "SOURCE direcory : $SRCDIR"

# absolute path to test directory. ~/test if not given as only argument
TESTDIR=${1:-~/test}
mkdir -p $TESTDIR
echo "TEST direcory : $TESTDIR"

UNAME=testing
UHOME=/home/$UNAME

# define TESTDEBUG in env to enable dev-mode. This enables :
#   - debug pasthrough for Xnest
#   - VNC port passthrough
DEBUGARGS="-v /tmp/.X11-unix/X0:/tmp/.X11-unix/X0 -e DISPLAY=$DISPLAY -p 5900:5900"

echo "Creating docker container"
docker create \
       --name beremiz_sikuli_current \
       -v $SRCDIR:$UHOME/src \
       -v $TESTDIR:$UHOME/test \
       `if [ "$TESTDEBUG" == "YES" ]; then echo $DEBUGARGS; fi` \
       -w $UHOME/test \
       -i -t beremiz_sikuli /bin/bash