Commit 7e4e14ed authored by Emeric Verschuur's avatar Emeric Verschuur

Add option to start service in privileged mode

parent 5f10c295
......@@ -12,3 +12,6 @@
# Default job SHELL
CITBX_DEFAULT_JOB_SHELL="/bin/bash"
#
# Set service dockers in privileged mode as default
#CITBX_DEFAULT_SERVICE_DOCKER_PRIVILEGED="true"
#
......@@ -450,6 +450,8 @@ case "$command" in
-d "Use a specific shell to run the job"
bashopts_declare -n CITBX_WAIT_FOR_SERVICE_START -l wait-srv-started -t number -v 0 \
-d "Wait for service start (time in seconds)"
bashopts_declare -n CITBX_DEFAULT_SERVICE_DOCKER_PRIVILEGED -l service-privileged -t boolean \
-d "Start service docker container in privileged mode"
CITBX_DOCKER_USER=${CITBX_DOCKER_USER:-root}
# Load job
......@@ -679,6 +681,9 @@ case "$CITBX_JOB_EXECUTOR" in
if [ -n "$1" ]; then
args+=(--entrypoint "$1")
fi
if [ "$CITBX_DEFAULT_SERVICE_DOCKER_PRIVILEGED" == "true" ]; then
args+=(--privileged)
fi
shift || true
print_info "Starting service $name..."
docker run -d "${args[@]}" "${CITBX_DOCKER_RUN_ARGS[@]}" "$image" "$@"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment