From 2b51b0e62d00f0ef96a0b3837150bc9241a32e28 Mon Sep 17 00:00:00 2001 From: Stephen Gaito Date: Fri, 19 Jun 2020 11:32:45 +0100 Subject: [PATCH] attempt to build docker image from deb archive --- buildScripts/createDockerUbuntuImageFromDeb | 66 +++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100755 buildScripts/createDockerUbuntuImageFromDeb diff --git a/buildScripts/createDockerUbuntuImageFromDeb b/buildScripts/createDockerUbuntuImageFromDeb new file mode 100755 index 0000000..adc3a87 --- /dev/null +++ b/buildScripts/createDockerUbuntuImageFromDeb @@ -0,0 +1,66 @@ +#!/bin/bash + +# This bash script creates a docker image from an existing pdf2htmlEX +# +# This is the part which must be run *outside* of any docker container. + +echo "" +echo "-------------------------------------------------------------------" +echo "CREATING pdf2htmlEX Docker Image (from deb archive)" +echo "-------------------------------------------------------------------" +echo "" + +# Collect everything that will be needed... + +source buildScripts/reSourceVersionEnvs + +source buildScripts/dockerFunctions + +set -ev + +mkdir -p imageBuild/dockerDir + +cd imageBuild/dockerDir + +cp $PWORKSPACE/$DIST/$DPKG_NAME . + +if [ -z "$DOCKER_FROM" ]; then + echo "" + read -p "Enter the docker image for the 'from' base: " DOCKER_FROM + echo "" + if [ -z "$DOCKER_FROM" ]; then + echo "DOCKER_FROM not set... so we can not build the docker image" + exit 1 + fi +fi + +if [ -z "$DOCKER_USERNAME" ]; then + echo "" + read -p "Enter a docker username: " DOCKER_USERNAME + echo "" + if [ -z "$DOCKER_USERNAME" ]; then + echo "DOCKER_USERNAME not set... so we can not build the docker image" + exit 1 + fi +fi + +export DOCKER_NAME="$DOCKER_USERNAME/pdf2htmlex:$PDF2HTMLEX_BRANCH-$BUILD_TIME" + +echo "export DOCKER_FROM=\"$DOCKER_FROM\"" >> ../../buildScripts/reSourceVersionEnvs +echo "export DOCKER_USERNAME=\"$DOCKER_USERNAME\"" >> ../../buildScripts/reSourceVersionEnvs +echo "export DOCKER_NAME=\"$DOCKER_NAME\"" >> ../../buildScripts/reSourceVersionEnvs + +cat > Dockerfile <