Change in osmo-ci[master]: docker: Use the same Dockerfile for jessie and stretch

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/.

Holger Freyther gerrit-no-reply at lists.osmocom.org
Tue Feb 19 05:06:53 UTC 2019


Holger Freyther has uploaded this change for review. ( https://gerrit.osmocom.org/12951


Change subject: docker: Use the same Dockerfile for jessie and stretch
......................................................................

docker: Use the same Dockerfile for jessie and stretch

The binaries built on the Jenkins to be used by the osmo-gsm-tester
require libgnutls.so.30. This is provided by the libgnutls30 package
which is not available on jessie (Debian 8) and a backport requires
some effort.

Re-use the existing Dockerfile for jessie and stretch (Debian 9) using
an argument. Refactor the shell script to pass the right argument. Add
the debian version into the tag name to make space for buster (Debian
10).

Change-Id: I44c8e49a548cb64defd2eba868ec4bd435de90ba
---
M docker/Dockerfile_osmocom_jenkins.amd64
M docker/rebuild_osmocom_jenkins_image.sh
2 files changed, 26 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/51/12951/1

diff --git a/docker/Dockerfile_osmocom_jenkins.amd64 b/docker/Dockerfile_osmocom_jenkins.amd64
index 48536ac..25a9f61 100644
--- a/docker/Dockerfile_osmocom_jenkins.amd64
+++ b/docker/Dockerfile_osmocom_jenkins.amd64
@@ -1,4 +1,5 @@
-FROM debian:jessie
+ARG DEBIAN_VERSION=jessie
+FROM debian:${DEBIAN_VERSION}
 
 RUN \
     echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list && \
diff --git a/docker/rebuild_osmocom_jenkins_image.sh b/docker/rebuild_osmocom_jenkins_image.sh
index b49292a..3dcca39 100755
--- a/docker/rebuild_osmocom_jenkins_image.sh
+++ b/docker/rebuild_osmocom_jenkins_image.sh
@@ -1,4 +1,24 @@
-#!/bin/sh
-# In case the debian apt archive has become out of sync, try a --no-cache build if it fails.
-docker build -t osmocom:amd64 -f Dockerfile_osmocom_jenkins.amd64 . \
- || docker build --no-cache -t osmocom:amd64 -f Dockerfile_osmocom_jenkins.amd64 .
+#!/bin/bash
+
+# Executes docker build with the given parameters and retry in case of error.
+function build_once() {
+	# In case the debian apt archive has become out of sync, try a
+	# --no-cache build if it fails.
+
+	# shellcheck disable=SC2068
+	docker build $@ -f Dockerfile_osmocom_jenkins.amd64 . \
+	|| docker build --no-cache $@ -f Dockerfile_osmocom_jenkins.amd64 .
+}
+
+# Builds a container with a debian version and tag name as parameter.
+function build_container() {
+	local tag_name=${1}
+	local debian_version=${2}
+
+	echo "Building for ${debian_version} and setting tag ${tag_name}"
+	build_once "-t" "${tag_name}" "--build-arg" DEBIAN_VERSION="${debian_version}"
+}
+
+# Create containers using jessie (Debian 8.0) and stretch (Debian 9.0) as base.
+build_container osmocom:amd64 jessie
+build_container osmocom:deb9_amd64 stretch

-- 
To view, visit https://gerrit.osmocom.org/12951
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I44c8e49a548cb64defd2eba868ec4bd435de90ba
Gerrit-Change-Number: 12951
Gerrit-PatchSet: 1
Gerrit-Owner: Holger Freyther <holger at freyther.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190219/e10b1a3e/attachment.htm>


More information about the gerrit-log mailing list