diff --git a/.gitignore b/.gitignore index 0aba0f6f..386d3f81 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .release +.common /_cache diff --git a/centos8-build/Dockerfile b/centos8-build/Dockerfile index 412816ce..001c1610 100644 --- a/centos8-build/Dockerfile +++ b/centos8-build/Dockerfile @@ -50,5 +50,8 @@ RUN dnf install -y \ sqlite-devel \ telnet +# Make respawn.sh part of this image, so it can be used by other images based on it +COPY .common/respawn.sh /usr/local/bin/respawn.sh + # Invalidate cache once the repository is updated ADD $OSMOCOM_REPO_MIRROR/repositories/network:/osmocom:/latest/CentOS_8/repodata/repomd.xml /tmp/repomd.xml diff --git a/centos8-obs-latest/Dockerfile b/centos8-obs-latest/Dockerfile index 4b2357b3..a9dfc9be 100644 --- a/centos8-obs-latest/Dockerfile +++ b/centos8-obs-latest/Dockerfile @@ -17,5 +17,8 @@ RUN dnf install -y dnf-utils wget && \ RUN dnf install -y \ telnet +# Make respawn.sh part of this image, so it can be used by other images based on it +COPY .common/respawn.sh /usr/local/bin/respawn.sh + # Invalidate cache once the repository is updated ADD $OSMOCOM_REPO_MIRROR/repositories/network:/osmocom:/latest/CentOS_8/repodata/repomd.xml /tmp/repomd.xml 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 119afead..2625e9e2 100644 --- a/debian-buster-build/Dockerfile +++ b/debian-buster-build/Dockerfile @@ -52,3 +52,6 @@ RUN apt-get update && \ stow \ wget && \ apt-get clean + +# Make respawn.sh part of this image, so it can be used by other images based on it +COPY .common/respawn.sh /usr/local/bin/respawn.sh diff --git a/debian-jessie-build/Dockerfile b/debian-jessie-build/Dockerfile index 60f6ca9b..b0437626 100644 --- a/debian-jessie-build/Dockerfile +++ b/debian-jessie-build/Dockerfile @@ -52,3 +52,6 @@ RUN apt-get update && \ stow \ wget && \ apt-get clean + +# Make respawn.sh part of this image, so it can be used by other images based on it +COPY .common/respawn.sh /usr/local/bin/respawn.sh diff --git a/debian-sid-build/Dockerfile b/debian-sid-build/Dockerfile index ffa86e2f..f4fe9907 100644 --- a/debian-sid-build/Dockerfile +++ b/debian-sid-build/Dockerfile @@ -50,3 +50,6 @@ RUN apt-get update && \ sqlite3 \ wget && \ apt-get clean + +# Make respawn.sh part of this image, so it can be used by other images based on it +COPY .common/respawn.sh /usr/local/bin/respawn.sh diff --git a/debian-stretch-obs-latest/Dockerfile b/debian-stretch-obs-latest/Dockerfile index 3bef05cf..04f831d6 100644 --- a/debian-stretch-obs-latest/Dockerfile +++ b/debian-stretch-obs-latest/Dockerfile @@ -18,5 +18,8 @@ RUN apt-key add /tmp/Release.key && \ rm /tmp/Release.key && \ echo "deb " $OSMOCOM_REPO " ./" > /etc/apt/sources.list.d/osmocom-latest.list +# Make respawn.sh part of this image, so it can be used by other images based on it +COPY .common/respawn.sh /usr/local/bin/respawn.sh + # Invalidate cache once the repository is updated ADD $OSMOCOM_REPO/Release /tmp/Release diff --git a/make/Makefile b/make/Makefile index f149291f..d2cacf3a 100644 --- a/make/Makefile +++ b/make/Makefile @@ -55,9 +55,12 @@ SHELL=/bin/bash build: pre-build docker-build post-build pre-build: + rm -rf .common + cp -r $(ROOT_DIR)/common .common post-build: + rm -rf .common post-push: diff --git a/osmo-bts-latest/Dockerfile b/osmo-bts-latest/Dockerfile index 202a29c1..2b419682 100644 --- a/osmo-bts-latest/Dockerfile +++ b/osmo-bts-latest/Dockerfile @@ -20,8 +20,6 @@ RUN case "$DISTRO" in \ ;; \ 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 24139163..00000000 --- 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 13df6280..77c1e512 100644 --- a/osmo-bts-master/Dockerfile +++ b/osmo-bts-master/Dockerfile @@ -30,8 +30,6 @@ RUN case "$DISTRO" in \ ;; \ 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 622f933f..7f1b3acb 100644 --- a/osmo-pcu-latest/Dockerfile +++ b/osmo-pcu-latest/Dockerfile @@ -17,8 +17,6 @@ RUN case "$DISTRO" in \ ;; \ 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 24139163..00000000 --- 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 f8e6ded5..41cd6d5e 100644 --- a/osmo-pcu-master/Dockerfile +++ b/osmo-pcu-master/Dockerfile @@ -21,8 +21,6 @@ RUN case "$DISTRO" in \ ;; \ 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 24139163..00000000 --- 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"