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
This commit is contained in:
Oliver Smith 2022-02-11 09:57:44 +01:00
parent 266cb2165c
commit 5c158b326a
4 changed files with 6 additions and 3 deletions

View File

@ -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

View File

@ -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 \

View File

@ -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 \

View File

@ -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 \