diff --git a/docker/dev/docker-entrypoint.sh b/docker/dev/docker-entrypoint.sh index 102951c6..fe0687e6 100755 --- a/docker/dev/docker-entrypoint.sh +++ b/docker/dev/docker-entrypoint.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Copyright (C) 2019 The Falco Authors. # @@ -16,19 +16,21 @@ # limitations under the License. # -#set -e +# set -e # Set the SYSDIG_SKIP_LOAD variable to skip loading the sysdig kernel module if [[ -z "${SYSDIG_SKIP_LOAD}" ]]; then echo "* Setting up /usr/src links from host" - for i in $(ls $SYSDIG_HOST_ROOT/usr/src) + for i in "$HOST_ROOT/usr/src"/* do - ln -s $SYSDIG_HOST_ROOT/usr/src/$i /usr/src/$i + if [ -f "$i" ]; then + ln -s "$i" "/usr/src/$i" + fi done /usr/bin/falco-probe-loader fi -exec "$@" +exec "$@" \ No newline at end of file diff --git a/docker/local/docker-entrypoint.sh b/docker/local/docker-entrypoint.sh index 102951c6..fe0687e6 100755 --- a/docker/local/docker-entrypoint.sh +++ b/docker/local/docker-entrypoint.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Copyright (C) 2019 The Falco Authors. # @@ -16,19 +16,21 @@ # limitations under the License. # -#set -e +# set -e # Set the SYSDIG_SKIP_LOAD variable to skip loading the sysdig kernel module if [[ -z "${SYSDIG_SKIP_LOAD}" ]]; then echo "* Setting up /usr/src links from host" - for i in $(ls $SYSDIG_HOST_ROOT/usr/src) + for i in "$HOST_ROOT/usr/src"/* do - ln -s $SYSDIG_HOST_ROOT/usr/src/$i /usr/src/$i + if [ -f "$i" ]; then + ln -s "$i" "/usr/src/$i" + fi done /usr/bin/falco-probe-loader fi -exec "$@" +exec "$@" \ No newline at end of file diff --git a/docker/rhel/docker-entrypoint.sh b/docker/rhel/docker-entrypoint.sh index 102951c6..fe0687e6 100755 --- a/docker/rhel/docker-entrypoint.sh +++ b/docker/rhel/docker-entrypoint.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Copyright (C) 2019 The Falco Authors. # @@ -16,19 +16,21 @@ # limitations under the License. # -#set -e +# set -e # Set the SYSDIG_SKIP_LOAD variable to skip loading the sysdig kernel module if [[ -z "${SYSDIG_SKIP_LOAD}" ]]; then echo "* Setting up /usr/src links from host" - for i in $(ls $SYSDIG_HOST_ROOT/usr/src) + for i in "$HOST_ROOT/usr/src"/* do - ln -s $SYSDIG_HOST_ROOT/usr/src/$i /usr/src/$i + if [ -f "$i" ]; then + ln -s "$i" "/usr/src/$i" + fi done /usr/bin/falco-probe-loader fi -exec "$@" +exec "$@" \ No newline at end of file diff --git a/docker/stable/docker-entrypoint.sh b/docker/stable/docker-entrypoint.sh index 102951c6..fe0687e6 100755 --- a/docker/stable/docker-entrypoint.sh +++ b/docker/stable/docker-entrypoint.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Copyright (C) 2019 The Falco Authors. # @@ -16,19 +16,21 @@ # limitations under the License. # -#set -e +# set -e # Set the SYSDIG_SKIP_LOAD variable to skip loading the sysdig kernel module if [[ -z "${SYSDIG_SKIP_LOAD}" ]]; then echo "* Setting up /usr/src links from host" - for i in $(ls $SYSDIG_HOST_ROOT/usr/src) + for i in "$HOST_ROOT/usr/src"/* do - ln -s $SYSDIG_HOST_ROOT/usr/src/$i /usr/src/$i + if [ -f "$i" ]; then + ln -s "$i" "/usr/src/$i" + fi done /usr/bin/falco-probe-loader fi -exec "$@" +exec "$@" \ No newline at end of file