2020-06-20 09:11:30 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# This shell 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 (run outside any docker container)"
|
2020-06-20 16:22:46 +00:00
|
|
|
echo " (based on Alpine linux $BUILD_DIST)"
|
2020-06-20 09:11:30 +00:00
|
|
|
echo "-------------------------------------------------------------------"
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
# Collect everything that will be needed...
|
|
|
|
|
|
|
|
# source buildScripts/reSourceVersionEnvs
|
|
|
|
. buildScripts/reSourceVersionEnvs
|
|
|
|
|
|
|
|
set -ev
|
|
|
|
|
|
|
|
mkdir -p imageBuild/dockerDir
|
|
|
|
|
|
|
|
cd imageBuild/dockerDir
|
|
|
|
|
2020-06-21 11:00:27 +00:00
|
|
|
cp ../$ALPINE_NAME.* .
|
|
|
|
|
2020-06-20 09:11:30 +00:00
|
|
|
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
|
|
|
|
|
2020-06-21 06:12:05 +00:00
|
|
|
export DOCKER_NAME="$DOCKER_USERNAME/pdf2htmlex:$PDF2HTMLEX_NAME"
|
2020-06-20 09:11:30 +00:00
|
|
|
|
|
|
|
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 <<DOCKERFILE_HERE_DOC
|
|
|
|
FROM $DOCKER_FROM
|
|
|
|
|
2020-06-21 13:02:44 +00:00
|
|
|
COPY ./$ALPINE_NAME.* /root && \
|
2020-06-22 21:53:45 +00:00
|
|
|
chmod a+x /root/$ALPINE_NAME.install
|
2020-06-21 11:00:27 +00:00
|
|
|
|
2020-06-21 13:02:44 +00:00
|
|
|
RUN /root/$ALPINE_NAME.install
|
2020-06-20 09:11:30 +00:00
|
|
|
|
|
|
|
ENTRYPOINT ["$PDF2HTMLEX_PREFIX/bin/pdf2htmlEX"]
|
|
|
|
DOCKERFILE_HERE_DOC
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
docker build -t $DOCKER_NAME dockerDir
|