diff --git a/docker/dev/Dockerfile b/docker/dev/Dockerfile index 81f1a801..622e8431 100644 --- a/docker/dev/Dockerfile +++ b/docker/dev/Dockerfile @@ -48,7 +48,11 @@ RUN curl -s https://s3.amazonaws.com/download.draios.com/DRAIOS-GPG-KEY.public | && apt-get clean \ && rm -rf /var/lib/apt/lists/* -RUN ln -s $SYSDIG_HOST_ROOT/lib/modules /lib/modules +# Some base images have an empty /lib/modules by default +# If it's not empty, docker build will fail instead of +# silently overwriting the existing directory +RUN rm -df /lib/modules \ + && ln -s $SYSDIG_HOST_ROOT/lib/modules /lib/modules COPY ./docker-entrypoint.sh / diff --git a/docker/local/Dockerfile b/docker/local/Dockerfile index 574786b2..1e86d2bc 100644 --- a/docker/local/Dockerfile +++ b/docker/local/Dockerfile @@ -41,7 +41,11 @@ RUN rm -rf /usr/bin/clang \ && ln -s /usr/bin/clang-7 /usr/bin/clang \ && ln -s /usr/bin/llc-7 /usr/bin/llc -RUN ln -s $SYSDIG_HOST_ROOT/lib/modules /lib/modules +# Some base images have an empty /lib/modules by default +# If it's not empty, docker build will fail instead of +# silently overwriting the existing directory +RUN rm -df /lib/modules \ + && ln -s $SYSDIG_HOST_ROOT/lib/modules /lib/modules ADD falco-${FALCO_VERSION}-x86_64.deb / RUN dpkg -i /falco-${FALCO_VERSION}-x86_64.deb diff --git a/docker/stable/Dockerfile b/docker/stable/Dockerfile index f52f4c56..4a2a968b 100644 --- a/docker/stable/Dockerfile +++ b/docker/stable/Dockerfile @@ -47,7 +47,11 @@ RUN curl -s https://s3.amazonaws.com/download.draios.com/DRAIOS-GPG-KEY.public | && apt-get clean \ && rm -rf /var/lib/apt/lists/* -RUN ln -s $SYSDIG_HOST_ROOT/lib/modules /lib/modules +# Some base images have an empty /lib/modules by default +# If it's not empty, docker build will fail instead of +# silently overwriting the existing directory +RUN rm -df /lib/modules \ + && ln -s $SYSDIG_HOST_ROOT/lib/modules /lib/modules COPY ./docker-entrypoint.sh /