Repository navigation
Expand file tree
/
Copy pathcreateContainerUbuntuImageFromDeb
More file actions
executable file
·78 lines (57 loc) · 1.94 KB
/
Copy pathcreateContainerUbuntuImageFromDeb
File metadata and controls
executable file
·78 lines (57 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/sh
# This shell script creates an OCI container from an existing pdf2htmlEX
#
# This is the part which must be run *outside* of any OCI container.
echo ""
echo "-------------------------------------------------------------------"
echo "CREATING pdf2htmlEX OCI Container Image (from deb archive)"
echo "-------------------------------------------------------------------"
echo ""
# Collect everything that will be needed...
# source buildScripts/reSourceVersionEnvs
. buildScripts/reSourceVersionEnvs
set -ev
cd imageBuild
mkdir -p containerDir
cp $DPKG_NAME containerDir
cd containerDir
if [ -z "$CONTAINER_FROM" ]; then
echo ""
read -p "Enter the container image for the 'from' base: " CONTAINER_FROM
echo ""
if [ -z "$CONTAINER_FROM" ]; then
echo "CONTAINER_FROM not set... so we can not build the container image"
exit 1
fi
fi
if [ -z "$DOCKER_HUB_USERNAME" ]; then
echo ""
read -p "Enter a docker hub username: " DOCKER_HUB_USERNAME
echo ""
if [ -z "$DOCKER_HUB_USERNAME" ]; then
echo "DOCKER_HUB_USERNAME not set... so we can not build the container image"
exit 1
fi
fi
if [ -x "$(which podman)" ]; then
alias docker=podman
fi
export CONTAINER_NAME="$DOCKER_HUB_USERNAME/pdf2htmlex:$PDF2HTMLEX_NAME"
echo "export CONTAINER_FROM=\"$CONTAINER_FROM\"" >> ../../buildScripts/reSourceVersionEnvs
echo "export DOCKER_HUB_USERNAME=\"$DOCKER_HUB_USERNAME\"" >> ../../buildScripts/reSourceVersionEnvs
echo "export CONTAINER_NAME=\"$CONTAINER_NAME\"" >> ../../buildScripts/reSourceVersionEnvs
cat > Dockerfile <<DOCKERFILE_HERE_DOC
FROM $CONTAINER_FROM
COPY ./$DPKG_NAME /root
RUN apt update && \
apt -y upgrade && \
apt -y --no-install-recommends install \
/root/$DPKG_NAME
# make the /pdf directory the default working directory for any run of
# pdf2htmlEX
#
WORKDIR /pdf
ENTRYPOINT ["$PDF2HTMLEX_PREFIX/bin/pdf2htmlEX"]
DOCKERFILE_HERE_DOC
cd ..
docker build -t $CONTAINER_NAME containerDir