From 5c158b326abe394a731094b197ef8ff08e019622 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Fri, 11 Feb 2022 09:57:44 +0100 Subject: [PATCH] treewide: fix missing --rm for "docker run" Add "--rm" to each "docker run" command, so they don't continuously fill up disk space. Fix this even in the pipework script. We don't use the code path there, but by always having --rm after "docker run" (same line or next line), a new lint script in osmo-ci I8ab9c291504475d670bdefc50c4524c5bdd4c880 can help us avoid this in the future. In ttcn3-ggsn-test/jenkins.sh, move one existing --rm in a later line upwards so the linter can find it. Related: SYS#5827, OS#5099 Related: https://github.com/jpetazzo/pipework/pull/248 Change-Id: I48b01c43fedf379b8a565eaab0369806d7831bd8 --- common/pipework | 2 +- jenkins-common.sh | 1 + ttcn3-fr-test/jenkins.sh | 2 ++ ttcn3-ggsn-test/jenkins.sh | 4 ++-- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/common/pipework b/common/pipework index 97ce66b5..1381aa98 100755 --- a/common/pipework +++ b/common/pipework @@ -423,7 +423,7 @@ else # use a locally installed client. case "$DHCP_CLIENT" in dhcp) - docker run -d --net container:$GUESTNAME --cap-add NET_ADMIN \ + docker run --rm -d --net container:$GUESTNAME --cap-add NET_ADMIN \ busybox udhcpc -i "$CONTAINER_IFNAME" -x "hostname:$GUESTNAME" \ $DHCP_OPTIONS \ >/dev/null diff --git a/jenkins-common.sh b/jenkins-common.sh index 3faf6a91..5571dd17 100644 --- a/jenkins-common.sh +++ b/jenkins-common.sh @@ -326,6 +326,7 @@ kernel_test_prepare() { "$CACHE_DIR/kernel-test/initrd-project-script.sh" docker run \ + --rm \ --cap-add=NET_ADMIN \ $(docker_kvm_param) \ --device /dev/net/tun:/dev/net/tun \ diff --git a/ttcn3-fr-test/jenkins.sh b/ttcn3-fr-test/jenkins.sh index 6dbc6f1c..34aa740c 100755 --- a/ttcn3-fr-test/jenkins.sh +++ b/ttcn3-fr-test/jenkins.sh @@ -25,6 +25,7 @@ mkdir $VOL_BASE_DIR/unix echo Starting container with FRNET docker run \ + --rm \ --cap-add=NET_RAW --cap-add=SYS_RAWIO \ $(docker_network_params $SUBNET 10) \ --ulimit core=-1 \ @@ -44,6 +45,7 @@ done echo Starting container with FR testsuite docker run \ + --rm \ --cap-add=NET_RAW --cap-add=SYS_RAWIO \ $(docker_network_params $SUBNET 103) \ --ulimit core=-1 \ diff --git a/ttcn3-ggsn-test/jenkins.sh b/ttcn3-ggsn-test/jenkins.sh index 53da74d3..c8968ad6 100755 --- a/ttcn3-ggsn-test/jenkins.sh +++ b/ttcn3-ggsn-test/jenkins.sh @@ -55,10 +55,10 @@ else " OSMO_SUT_HOST="172.18.$SUBNET.201" fi -docker run --cap-add=NET_ADMIN \ +docker run --rm \ + --cap-add=NET_ADMIN \ --device /dev/net/tun:/dev/net/tun \ --sysctl net.ipv6.conf.all.disable_ipv6=0 \ - --rm \ --ulimit core=-1 \ -v $VOL_BASE_DIR/ggsn:/data \ --name ${BUILD_TAG}-ggsn -d \