<p>Holger Freyther has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/12951">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">docker: Use the same Dockerfile for jessie and stretch<br><br>The binaries built on the Jenkins to be used by the osmo-gsm-tester<br>require libgnutls.so.30. This is provided by the libgnutls30 package<br>which is not available on jessie (Debian 8) and a backport requires<br>some effort.<br><br>Re-use the existing Dockerfile for jessie and stretch (Debian 9) using<br>an argument. Refactor the shell script to pass the right argument. Add<br>the debian version into the tag name to make space for buster (Debian<br>10).<br><br>Change-Id: I44c8e49a548cb64defd2eba868ec4bd435de90ba<br>---<br>M docker/Dockerfile_osmocom_jenkins.amd64<br>M docker/rebuild_osmocom_jenkins_image.sh<br>2 files changed, 26 insertions(+), 5 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/51/12951/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/docker/Dockerfile_osmocom_jenkins.amd64 b/docker/Dockerfile_osmocom_jenkins.amd64</span><br><span>index 48536ac..25a9f61 100644</span><br><span>--- a/docker/Dockerfile_osmocom_jenkins.amd64</span><br><span>+++ b/docker/Dockerfile_osmocom_jenkins.amd64</span><br><span>@@ -1,4 +1,5 @@</span><br><span style="color: hsl(0, 100%, 40%);">-FROM debian:jessie</span><br><span style="color: hsl(120, 100%, 40%);">+ARG DEBIAN_VERSION=jessie</span><br><span style="color: hsl(120, 100%, 40%);">+FROM debian:${DEBIAN_VERSION}</span><br><span> </span><br><span> RUN \</span><br><span>     echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list && \</span><br><span>diff --git a/docker/rebuild_osmocom_jenkins_image.sh b/docker/rebuild_osmocom_jenkins_image.sh</span><br><span>index b49292a..3dcca39 100755</span><br><span>--- a/docker/rebuild_osmocom_jenkins_image.sh</span><br><span>+++ b/docker/rebuild_osmocom_jenkins_image.sh</span><br><span>@@ -1,4 +1,24 @@</span><br><span style="color: hsl(0, 100%, 40%);">-#!/bin/sh</span><br><span style="color: hsl(0, 100%, 40%);">-# In case the debian apt archive has become out of sync, try a --no-cache build if it fails.</span><br><span style="color: hsl(0, 100%, 40%);">-docker build -t osmocom:amd64 -f Dockerfile_osmocom_jenkins.amd64 . \</span><br><span style="color: hsl(0, 100%, 40%);">- || docker build --no-cache -t osmocom:amd64 -f Dockerfile_osmocom_jenkins.amd64 .</span><br><span style="color: hsl(120, 100%, 40%);">+#!/bin/bash</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# Executes docker build with the given parameters and retry in case of error.</span><br><span style="color: hsl(120, 100%, 40%);">+function build_once() {</span><br><span style="color: hsl(120, 100%, 40%);">+        # In case the debian apt archive has become out of sync, try a</span><br><span style="color: hsl(120, 100%, 40%);">+        # --no-cache build if it fails.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     # shellcheck disable=SC2068</span><br><span style="color: hsl(120, 100%, 40%);">+   docker build $@ -f Dockerfile_osmocom_jenkins.amd64 . \</span><br><span style="color: hsl(120, 100%, 40%);">+       || docker build --no-cache $@ -f Dockerfile_osmocom_jenkins.amd64 .</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# Builds a container with a debian version and tag name as parameter.</span><br><span style="color: hsl(120, 100%, 40%);">+function build_container() {</span><br><span style="color: hsl(120, 100%, 40%);">+ local tag_name=${1}</span><br><span style="color: hsl(120, 100%, 40%);">+   local debian_version=${2}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   echo "Building for ${debian_version} and setting tag ${tag_name}"</span><br><span style="color: hsl(120, 100%, 40%);">+   build_once "-t" "${tag_name}" "--build-arg" DEBIAN_VERSION="${debian_version}"</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# Create containers using jessie (Debian 8.0) and stretch (Debian 9.0) as base.</span><br><span style="color: hsl(120, 100%, 40%);">+build_container osmocom:amd64 jessie</span><br><span style="color: hsl(120, 100%, 40%);">+build_container osmocom:deb9_amd64 stretch</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/12951">change 12951</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/12951"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-ci </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I44c8e49a548cb64defd2eba868ec4bd435de90ba </div>
<div style="display:none"> Gerrit-Change-Number: 12951 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Holger Freyther <holger@freyther.de> </div>