TT#29356 Add Jessie based Dockerfile for Jenkins tap-tests

It is a popular test, trying to keep the small Docker image size.

The image will be used to migrate all Jenkins tap-tests to Docker.
It will unblock the nodes "jenkins-slave*" migration to Debian stretch.

Later we will be able to switch jenkins on "NGCP release specific Docker images"
(using Docker tags like we do for all other Docker images)
and then upgrade Docker image to Debian stretch in trunk
(while we still be able to keep jessie for some Git repos
in case of emergency).

The script checkbashisms.pl extracted manually
because the package "devscripts" has too big dependencies list which
increases the Docker image size three times (till ~600Mb).

Also we have to use "/code/source" while normally we have just "/code"
because tap_tool_dispatcher from jenkins-debian-glue is strict to the folder name:

> if ! [ -d source ] ; then
>   echo "Error: no source directory found, please run inside Jenkins." >&2
>   exit 1
>fi

Change-Id: I21fb5c088db3f2966b2e374647061059dda11329
changes/79/18079/5
Alexander Lutay 9 years ago
parent 4b1bb087ce
commit 6ed91972b1

@ -0,0 +1,47 @@
# DOCKER_NAME=jenkins-tap-test-jessie
FROM docker.mgm.sipwise.com/sipwise-jessie:latest
# Important! Update this no-op ENV variable when this Dockerfile
# is updated with the current date. It will force refresh of all
# of the base images and things like `apt-get update` won't be using
# old cached versions when the Dockerfile is built.
ENV REFRESHED_AT 2018-01-03
RUN echo "# generated by Dockerfile from jenkins-tap-test-jessie at $(date)\n\
deb https://deb.sipwise.com/autobuild/ internal-jessie main\n" > /etc/apt/sources.list.d/sipwise-internal.list
RUN apt-get update && apt-get install --assume-yes --no-install-recommends \
shellcheck pep8 libperl-critic-perl ruby jenkins-debian-glue parallel \
file binutils xz-utils && \
apt-get clean
# The package devscripts has a huge list of dependencies and
# we need checkbashisms scipt only, providing it manually
RUN mkdir /tmp/zzz && cd /tmp/zzz && \
apt-get download devscripts && \
ar x devscripts_*.deb && \
tar -C / -p -xvf data.tar.xz ./usr/bin/checkbashisms && \
rm -rf /tmp/zzz
RUN echo 'SHELL=bash WORKSPACE=/code/ /usr/bin/tap_tool_dispatcher' >>/root/.bash_history
WORKDIR /code/
################################################################################
# Instructions for usage
# ----------------------
# When you want to build the base image from scratch
# (jump to the next section if you don't want to build yourself!):
# NOTE: run the following command from root folder of git repository:
#
# % docker build --tag="jenkins-tap-test-jessie" -f t/tap-tests-docker/Dockerfile .
# % docker run --rm -i -t -v $(pwd):/code/source:rw jenkins-tap-test-jessie:latest bash
#
# Use the existing docker image:
# % docker pull docker.mgm.sipwise.com/jenkins-tap-test-jessie
# % docker run --rm -i -t -v $(pwd):/code/source:rw docker.mgm.sipwise.com/jenkins-tap-test-jessie:latest bash
#
# Inside docker (the command is in history, just press UP button):
# SHELL=bash WORKSPACE=/code/ /usr/bin/tap_tool_dispatcher
#
################################################################################
Loading…
Cancel
Save