-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sh
executable file
·65 lines (53 loc) · 1.48 KB
/
build.sh
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
#!/usr/bin/env bash
set -eux
function build_qpdf()
{
local -r image_tag="qpdf:${1}"
docker build --tag "${image_tag}" --build-arg QPDF_VERSION="${1}" --file qpdf.dockerfile --progress plain .
image_id=$(docker create "${image_tag}")
mkdir -v -p outputs
docker cp "${image_id}":/usr/src/qpdf/ outputs/
}
function build_ghostscript()
{
local -r image_tag="ghostscript:${1}"
docker build --tag "${image_tag}" --build-arg GS_VERSION="${1}" --file ghostscript.dockerfile --progress plain .
image_id=$(docker create "${image_tag}")
mkdir -v -p outputs
docker cp "${image_id}":/usr/src/ghostscript/ outputs/
}
function build_jbig2enc()
{
local -r image_tag="jbig2enc:${1}"
docker build --tag "${image_tag}" --build-arg JBIG2ENC_VERSION="${1}" --file jbig2enc.dockerfile --progress plain .
image_id=$(docker create "${image_tag}")
mkdir -v -p outputs
docker cp "${image_id}":/usr/src/jbig2enc/ outputs/
}
function build_psycopg()
{
local -r image_tag="psycopg:${1}"
docker build --tag "${image_tag}" --build-arg PSYCOPG_VERSION="${1}" --file psycopg.dockerfile --progress plain .
image_id=$(docker create "${image_tag}")
mkdir -v -p outputs/psycopg
docker cp "${image_id}":/usr/src/psycopg/ outputs/
}
subcommand=$1
case "${subcommand}" in
qpdf)
build_qpdf "${2:-11.9.1}"
;;
ghostscript)
build_ghostscript "${2:-10.03.1}"
;;
jbig2enc)
build_jbig2enc "${2:-0.29}"
;;
psycopg)
build_psycopg "${2:-3.2.3}"
;;
*)
echo "${1} is not a valid argument"
exit 1
;;
esac