1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 13:00:08 +00:00
pdf2htmlEX/buildScripts/createDockerImage

85 lines
2.0 KiB
Plaintext
Raw Normal View History

2019-11-23 10:25:09 +00:00
#!/bin/bash
# This bash script creates a docker image from an existing pdf2htmlEX
2019-11-23 10:25:09 +00:00
echo ""
echo "-------------------------------------------------------------------"
echo "CREATING pdf2htmlEX Docker Image"
echo "-------------------------------------------------------------------"
echo ""
# Collect everything that will be needed...
2019-11-23 10:25:09 +00:00
source buildScripts/reSourceVersionEnvs
2019-11-23 10:25:09 +00:00
source buildScripts/dockerFunctions
2020-06-02 11:58:27 +00:00
set -ev
2019-11-29 09:43:07 +00:00
mkdir -p imageBuild/dockerDir
cd pdf2htmlEX/build
2019-11-29 09:43:07 +00:00
sudo rm -rf install_manifest.txt
2019-11-29 09:43:07 +00:00
make install DESTDIR=../../imageBuild/dockerDir
2019-11-29 09:43:07 +00:00
cd ../../poppler-data
2020-05-31 18:34:48 +00:00
make install \
prefix=$PDF2HTMLEX_PREFIX \
datadir=$PDF2HTMLEX_PREFIX/share/pdf2htmlEX \
DESTDIR=../imageBuild/dockerDir
cd ../imageBuild/dockerDir
copy_deps
# Now. IF we have docker, THEN build the docker image...
2019-12-17 16:01:02 +00:00
2020-05-28 11:42:35 +00:00
if [ -x "$(which docker)" ]; then
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
2019-12-17 16:01:02 +00:00
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
delete_blacklisted
2019-11-28 12:21:58 +00:00
cat > Dockerfile <<DOCKERFILE_HERE_DOC
FROM $DOCKER_FROM
COPY ./ /
RUN ldconfig
ENTRYPOINT ["$PDF2HTMLEX_PREFIX/bin/pdf2htmlEX"]
DOCKERFILE_HERE_DOC
cd ..
2019-11-28 14:07:07 +00:00
docker build -t $DOCKER_NAME dockerDir
2019-11-23 10:25:09 +00:00
else
echo "Docker is not installed... skipping creation of a docker image."
fi
2019-11-23 10:25:09 +00:00