Build: add gcc-9.2.0 to docker build
[marnav.git] / bin / docker-prepare-image.sh
blobe24ab2daacadb3b23490f7d2d4b4ac8bdc4e1826
1 #!/bin/bash -e
3 SCRIPT_BASE=$(dirname `readlink -f $0`)
5 supported_compilers=(
6 "gcc-4.9.4"
7 "gcc-5.5.0"
8 "gcc-6.5.0"
9 "gcc-7.4.0"
10 "gcc-8.3.0"
11 "gcc-9.1.0"
12 "gcc-9.2.0"
13 # "clang-3.6.1"
14 # "clang-3.6.2"
15 # "clang-3.7.0"
16 # "clang-3.7.1"
17 # "clang-3.8.1"
18 # "clang-3.9.0"
19 "clang-3.9.1"
20 # "clang-4.0.0"
21 # "clang-4.0.1"
22 # "clang-5.0.0"
23 # "clang-5.0.1"
24 "clang-5.0.2"
25 "clang-6.0.0"
26 # "clang-6.0.1"
27 # "clang-7.0.0"
28 # "clang-7.0.1"
29 "clang-7.1.0"
30 "clang-8.0.0"
33 name=marnav
34 account=mariokonrad/
36 function build_image()
38 compiler=$1
39 compiler_name=${compiler%-*}
40 compiler_version=${compiler#${compiler_name}-}
42 docker build \
43 --force-rm \
44 --build-arg compiler_version=${compiler_version} \
45 --tag ${account}${name}:${compiler} \
46 --file ${SCRIPT_BASE}/docker/Dockerfile.${compiler_name} \
47 ${SCRIPT_BASE}/docker
50 function usage()
52 echo "usage: $(basename $0) compiler"
53 echo ""
54 echo " supported compilers:"
55 for v in ${supported_compilers[@]} ; do
56 echo " - $v"
57 done
58 echo ""
61 if [ $# -ne 1 ] ; then
62 usage
63 exit 1
66 for v in ${supported_compilers[@]} ; do
67 if [ "${v}" == "$1" ] ; then
68 build_image $1
69 exit 1
71 done
72 echo "error: specified compiler not supported: $1"
73 exit 1