Change in docker-playground[master]: Make respawn.sh a common part of *-build/-obs images

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

fixeria gerrit-no-reply at lists.osmocom.org
Wed Mar 10 00:09:23 UTC 2021


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/docker-playground/+/23303 )


Change subject: Make respawn.sh a common part of *-build/-obs images
......................................................................

Make respawn.sh a common part of *-build/-obs images

Maintaining several versions of the same file in different folders
is a bad idea, because at some point their content gets out of sync.
This is exactly what happened to 'respawn.sh': sleep()ing was only
implemented in 'osmo-bts-master/respawn.sh', other versions of this
file would simply ignore '$SLEEP_BEFORE_RESPAWN'.

The easiest solution would be to have all common files in a single
directory, however Docker does not allow to ADD files from outside
of the build context.  In other words, all files must be in the
same directory with the Dockerfile itself.

At the same time, Docker allows the first argument of ADD to be
an URL, and at least HTTP(S) is supported.  Most of our images
require the Internet connectivity anyway, so let's make it grab
'respawn.sh' from https://git.osmocom.org/docker-playground/.

Change-Id: I3ec86c8610b3b43d39ea8e3da444861d317ced4e
---
M centos8-build/Dockerfile
M centos8-obs-latest/Dockerfile
R common/respawn.sh
M debian-buster-build/Dockerfile
M debian-jessie-build/Dockerfile
M debian-sid-build/Dockerfile
M debian-stretch-obs-latest/Dockerfile
M osmo-bts-latest/Dockerfile
D osmo-bts-latest/respawn.sh
M osmo-bts-master/Dockerfile
M osmo-pcu-latest/Dockerfile
D osmo-pcu-latest/respawn.sh
M osmo-pcu-master/Dockerfile
D osmo-pcu-master/respawn.sh
14 files changed, 18 insertions(+), 53 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/03/23303/1

diff --git a/centos8-build/Dockerfile b/centos8-build/Dockerfile
index 412816c..8a1125b 100644
--- a/centos8-build/Dockerfile
+++ b/centos8-build/Dockerfile
@@ -52,3 +52,6 @@
 
 # Invalidate cache once the repository is updated
 ADD	$OSMOCOM_REPO_MIRROR/repositories/network:/osmocom:/latest/CentOS_8/repodata/repomd.xml /tmp/repomd.xml
+
+# Make respawn.sh part of this image, so it can be used by other images based on it
+ADD    https://git.osmocom.org/docker-playground/plain/common/respawn.sh /usr/local/bin/respawn.sh
diff --git a/centos8-obs-latest/Dockerfile b/centos8-obs-latest/Dockerfile
index 4b2357b..37a2770 100644
--- a/centos8-obs-latest/Dockerfile
+++ b/centos8-obs-latest/Dockerfile
@@ -19,3 +19,6 @@
 
 # Invalidate cache once the repository is updated
 ADD	$OSMOCOM_REPO_MIRROR/repositories/network:/osmocom:/latest/CentOS_8/repodata/repomd.xml /tmp/repomd.xml
+
+# Make respawn.sh part of this image, so it can be used by other images based on it
+ADD	https://git.osmocom.org/docker-playground/plain/common/respawn.sh /usr/local/bin/respawn.sh
diff --git a/osmo-bts-master/respawn.sh b/common/respawn.sh
similarity index 100%
rename from osmo-bts-master/respawn.sh
rename to common/respawn.sh
diff --git a/debian-buster-build/Dockerfile b/debian-buster-build/Dockerfile
index 119afea..aca4a4d 100644
--- a/debian-buster-build/Dockerfile
+++ b/debian-buster-build/Dockerfile
@@ -52,3 +52,6 @@
 		stow \
 		wget && \
 	apt-get clean
+
+# Make respawn.sh part of this image, so it can be used by other images based on it
+ADD	https://git.osmocom.org/docker-playground/plain/common/respawn.sh /usr/local/bin/respawn.sh
diff --git a/debian-jessie-build/Dockerfile b/debian-jessie-build/Dockerfile
index 60f6ca9..74f4f46 100644
--- a/debian-jessie-build/Dockerfile
+++ b/debian-jessie-build/Dockerfile
@@ -52,3 +52,6 @@
 		stow \
 		wget && \
 	apt-get clean
+
+# Make respawn.sh part of this image, so it can be used by other images based on it
+ADD	https://git.osmocom.org/docker-playground/plain/common/respawn.sh /usr/local/bin/respawn.sh
diff --git a/debian-sid-build/Dockerfile b/debian-sid-build/Dockerfile
index ffa86e2..256840b 100644
--- a/debian-sid-build/Dockerfile
+++ b/debian-sid-build/Dockerfile
@@ -50,3 +50,6 @@
 		sqlite3 \
 		wget && \
 	apt-get clean
+
+# Make respawn.sh part of this image, so it can be used by other images based on it
+ADD	https://git.osmocom.org/docker-playground/plain/common/respawn.sh /usr/local/bin/respawn.sh
diff --git a/debian-stretch-obs-latest/Dockerfile b/debian-stretch-obs-latest/Dockerfile
index 3bef05c..9c4d818 100644
--- a/debian-stretch-obs-latest/Dockerfile
+++ b/debian-stretch-obs-latest/Dockerfile
@@ -20,3 +20,6 @@
 
 # Invalidate cache once the repository is updated
 ADD	$OSMOCOM_REPO/Release /tmp/Release
+
+# Make respawn.sh part of this image, so it can be used by other images based on it
+ADD	https://git.osmocom.org/docker-playground/plain/common/respawn.sh /usr/local/bin/respawn.sh
diff --git a/osmo-bts-latest/Dockerfile b/osmo-bts-latest/Dockerfile
index 202a29c..2b41968 100644
--- a/osmo-bts-latest/Dockerfile
+++ b/osmo-bts-latest/Dockerfile
@@ -20,8 +20,6 @@
 		;; \
 	esac
 
-ADD	respawn.sh /usr/local/bin/respawn.sh
-
 WORKDIR	/tmp
 
 VOLUME	/data
diff --git a/osmo-bts-latest/respawn.sh b/osmo-bts-latest/respawn.sh
deleted file mode 100755
index 2413916..0000000
--- a/osmo-bts-latest/respawn.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-trap "kill 0" EXIT
-
-i=0
-max_i=500
-while [ $i -lt $max_i ]; do
-	echo "$i: starting: $*"
-	$* &
-	LAST_PID=$!
-	wait $LAST_PID
-	echo "$i: stopped pid $LAST_PID with status $?"
-	i=$(expr $i + 1)
-done
-echo "exiting after $max_i runs"
diff --git a/osmo-bts-master/Dockerfile b/osmo-bts-master/Dockerfile
index 13df628..77c1e51 100644
--- a/osmo-bts-master/Dockerfile
+++ b/osmo-bts-master/Dockerfile
@@ -30,8 +30,6 @@
 		;; \
 	esac
 
-ADD	respawn.sh /usr/local/bin/respawn.sh
-
 WORKDIR	/tmp
 
 ARG	OSMO_BTS_BRANCH="master"
diff --git a/osmo-pcu-latest/Dockerfile b/osmo-pcu-latest/Dockerfile
index 622f933..7f1b3ac 100644
--- a/osmo-pcu-latest/Dockerfile
+++ b/osmo-pcu-latest/Dockerfile
@@ -17,8 +17,6 @@
 		;; \
 	esac
 
-ADD	respawn.sh /usr/local/bin/respawn.sh
-
 WORKDIR	/tmp
 
 VOLUME	/data
diff --git a/osmo-pcu-latest/respawn.sh b/osmo-pcu-latest/respawn.sh
deleted file mode 100755
index 2413916..0000000
--- a/osmo-pcu-latest/respawn.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-trap "kill 0" EXIT
-
-i=0
-max_i=500
-while [ $i -lt $max_i ]; do
-	echo "$i: starting: $*"
-	$* &
-	LAST_PID=$!
-	wait $LAST_PID
-	echo "$i: stopped pid $LAST_PID with status $?"
-	i=$(expr $i + 1)
-done
-echo "exiting after $max_i runs"
diff --git a/osmo-pcu-master/Dockerfile b/osmo-pcu-master/Dockerfile
index f8e6ded..41cd6d5 100644
--- a/osmo-pcu-master/Dockerfile
+++ b/osmo-pcu-master/Dockerfile
@@ -21,8 +21,6 @@
 		;; \
 	esac
 
-ADD	respawn.sh /usr/local/bin/respawn.sh
-
 WORKDIR	/tmp
 
 ARG	OSMO_PCU_BRANCH="master"
diff --git a/osmo-pcu-master/respawn.sh b/osmo-pcu-master/respawn.sh
deleted file mode 100755
index 2413916..0000000
--- a/osmo-pcu-master/respawn.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-trap "kill 0" EXIT
-
-i=0
-max_i=500
-while [ $i -lt $max_i ]; do
-	echo "$i: starting: $*"
-	$* &
-	LAST_PID=$!
-	wait $LAST_PID
-	echo "$i: stopped pid $LAST_PID with status $?"
-	i=$(expr $i + 1)
-done
-echo "exiting after $max_i runs"

-- 
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/23303
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I3ec86c8610b3b43d39ea8e3da444861d317ced4e
Gerrit-Change-Number: 23303
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210310/a0fa08b3/attachment.htm>


More information about the gerrit-log mailing list