osmith has uploaded this change for review.
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.
Related: SYS#5827, OS#5099
Change-Id: I48b01c43fedf379b8a565eaab0369806d7831bd8
---
M common/pipework
M jenkins-common.sh
M ttcn3-fr-test/jenkins.sh
M ttcn3-ggsn-test/jenkins.sh
4 files changed, 6 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/60/27160/1
diff --git a/common/pipework b/common/pipework
index 97ce66b..1381aa9 100755
--- a/common/pipework
+++ b/common/pipework
@@ -423,7 +423,7 @@
# 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 3faf6a9..5571dd1 100644
--- a/jenkins-common.sh
+++ b/jenkins-common.sh
@@ -326,6 +326,7 @@
"$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 6dbc6f1..34aa740 100755
--- a/ttcn3-fr-test/jenkins.sh
+++ b/ttcn3-fr-test/jenkins.sh
@@ -25,6 +25,7 @@
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 @@
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 53da74d..ad160b4 100755
--- a/ttcn3-ggsn-test/jenkins.sh
+++ b/ttcn3-ggsn-test/jenkins.sh
@@ -55,7 +55,8 @@
"
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 \
To view, visit change 27160. To unsubscribe, or for help writing mail filters, visit settings.