From 6288036ed49cb7d9e9c62b53b66f0d93a66de6fe Mon Sep 17 00:00:00 2001 From: Richard Fussenegger Date: Wed, 13 Apr 2022 10:39:55 +0200 Subject: [PATCH] Removed `modprobe` Script (#1247) [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Removed `modprobe` Script I was able to find out that this script originates from https://github.com/docker-library/docker/blob/master/modprobe.sh but our image does not have `lsmod` nor `modprobe` installed. Hence, if it were in use, it would fail every time. 🤔 * fix: correct command order Co-authored-by: toast-gear --- runner/Dockerfile.dindrunner | 3 ++- runner/modprobe | 21 --------------------- 2 files changed, 2 insertions(+), 22 deletions(-) delete mode 100755 runner/modprobe diff --git a/runner/Dockerfile.dindrunner b/runner/Dockerfile.dindrunner index 6e196c1c..8b3e071c 100644 --- a/runner/Dockerfile.dindrunner +++ b/runner/Dockerfile.dindrunner @@ -100,8 +100,9 @@ RUN mkdir /opt/hostedtoolcache \ # We place the scripts in `/usr/bin` so that users who extend this image can # override them with scripts of the same name placed in `/usr/local/bin`. -COPY modprobe entrypoint.sh startup.sh logger.bash /usr/bin/ +COPY entrypoint.sh logger.bash startup.sh /usr/bin/ COPY supervisor/ /etc/supervisor/conf.d/ +RUN chmod +x /usr/bin/startup.sh /usr/bin/entrypoint.sh # arch command on OS X reports "i386" for Intel CPUs regardless of bitness RUN export ARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) \ diff --git a/runner/modprobe b/runner/modprobe deleted file mode 100755 index 4d58c9d7..00000000 --- a/runner/modprobe +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -set -eu - -# "modprobe" without modprobe -# https://twitter.com/lucabruno/status/902934379835662336 - -# this isn't 100% fool-proof, but it'll have a much higher success rate than simply using the "real" modprobe - -# Docker often uses "modprobe -va foo bar baz" -# so we ignore modules that start with "-" -for module; do - if [ "${module#-}" = "$module" ]; then - ip link show "$module" || true - lsmod | grep "$module" || true - fi -done - -# remove /usr/local/... from PATH so we can exec the real modprobe as a last resort -export PATH='/usr/sbin:/usr/bin:/sbin:/bin' -exec modprobe "$@"