From f3e1d8e62122aa2e71008cf540ad0e783d011ae7 Mon Sep 17 00:00:00 2001 From: Alexander Lutay Date: Tue, 19 Sep 2017 16:03:10 +0200 Subject: [PATCH] TT#22402 Switch janus-admin Dockerfile to Debian stretch We have to install 'npm' explicitly here as it is no longer provided by package 'nodejs' in Debian stretch. We have to install 'nodejs-legacy' otherwise /usr/bin/node is not available and test 'janus-admin-unit-test-docker' fails: > + docker run --rm -i --entrypoint /bin/bash -v /var/lib/jenkins/workspace/janus-admin-unit-test-docker/source/:/code:ro \ > -v /var/lib/jenkins/workspace/janus-admin-unit-test-docker/results:/results:rw \ > docker.mgm.sipwise.com/janus-admin-stretch:I3370beedf30495497d01ec42eb292f90bce2b0a2 -c /code/t/testrunner > ### Copying and moving files > ################################################################################ > Finished main setup, now running tests ... > > > janus-admin@1.0.4 test /tmp/code > > mocha -R spec --full-trace test/*-spec.js > > /usr/bin/env: 'node': No such file or directory > npm ERR! Test failed. See above for more details. > npm WARN This failure might be due to the use of legacy binary "node" > npm WARN For further explanations, please read > /usr/share/doc/nodejs/README.Debian > > npm ERR! not ok code 0 You can find more information about node/nodejs name convention here: https://lists.debian.org/debian-devel-announce/2012/07/msg00002.html So far, we need to install 'nodejs-legacy' to provide /usr/bin/node. Change-Id: I3370beedf30495497d01ec42eb292f90bce2b0a2 --- t/Dockerfile | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/t/Dockerfile b/t/Dockerfile index 29759ea..f453815 100644 --- a/t/Dockerfile +++ b/t/Dockerfile @@ -1,19 +1,21 @@ -# DOCKER_NAME=janus-admin-jessie -FROM docker.mgm.sipwise.com/sipwise-jessie:latest +# DOCKER_NAME=janus-admin-stretch +FROM docker.mgm.sipwise.com/sipwise-stretch: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 2017-05-09 +ENV REFRESHED_AT 2017-09-25 -# TODO - the release-trunk-jessie is too dynamic yet, though required build deps -RUN echo "deb https://deb.sipwise.com/autobuild/ release-trunk-jessie main" >>/etc/apt/sources.list +# TODO - the release-trunk-stretch is too dynamic yet, though required build deps +RUN echo "deb https://deb.sipwise.com/autobuild/ release-trunk-stretch main" >>/etc/apt/sources.list RUN apt-get update RUN apt-get install --assume-yes \ curl \ - nodejs + nodejs \ + nodejs-legacy \ + npm ADD package.json /tmp/ ADD npm-shrinkwrap.json /tmp/ @@ -32,13 +34,13 @@ WORKDIR /code # ---------------------- # 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 commands from root folder of git repository: -# % docker build --tag="janus-admin-jessie" -f ./t/Dockerfile . -# % docker run --rm -i -t -v $(pwd):/code:ro -v /results janus-admin-jessie:latest bash +# % docker build --tag="janus-admin-stretch" -f ./t/Dockerfile . +# % docker run --rm -i -t -v $(pwd):/code:ro -v /results janus-admin-stretch:latest bash # # Use the existing docker image: -# % docker pull docker.mgm.sipwise.com/janus-admin-jessie +# % docker pull docker.mgm.sipwise.com/janus-admin-stretch # NOTE: run the following command from root folder of git repository: -# % docker run --rm -i -t -v $(pwd):/code:ro -v /results docker.mgm.sipwise.com/janus-admin-jessie:latest bash +# % docker run --rm -i -t -v $(pwd):/code:ro -v /results docker.mgm.sipwise.com/janus-admin-stretch:latest bash # # Inside docker: # cd /code && ./t/testrunner