diff --git a/docker/driverloader/Dockerfile b/docker/driverloader/Dockerfile new file mode 100644 index 00000000..af3a6979 --- /dev/null +++ b/docker/driverloader/Dockerfile @@ -0,0 +1,14 @@ +ARG FALCO_VERSION=latest +FROM falcosecurity/falco:${FALCO_VERSION} + +LABEL maintainer="cncf-falco-dev@lists.cncf.io" + +LABEL usage="docker run -i -t -v /dev:/host/dev -v /proc:/host/proc:ro -v /boot:/host/boot:ro -v /lib/modules:/host/lib/modules:ro -v /usr:/host/usr:ro --name NAME IMAGE" + +ENV FALCO_VERSION=${FALCO_VERSION} +ENV HOST_ROOT /host +ENV HOME /root + +COPY ./docker-entrypoint.sh / + +ENTRYPOINT ["/docker-entrypoint.sh"] \ No newline at end of file diff --git a/docker/driverloader/docker-entrypoint.sh b/docker/driverloader/docker-entrypoint.sh new file mode 100755 index 00000000..3a76d163 --- /dev/null +++ b/docker/driverloader/docker-entrypoint.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# +# Copyright (C) 2020 The Falco Authors. +# +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# set -e + + +echo "* Setting up /usr/src links from host" + +for i in "$HOST_ROOT/usr/src"/* +do + base=$(basename "$i") + ln -s "$i" "/usr/src/$base" +done + +/usr/bin/falco-driver-loader $1 \ No newline at end of file