Doc: group obsolete NMEA sentences
[marnav.git] / bin / docker-prepare-image.sh
blob983f1a015b1ace3aa1172c9ad743fdadc073309e
1 #!/bin/bash -e
3 SCRIPT_BASE=$(dirname `readlink -f $0`)
5 supported_compilers=(
6 "gcc-4.9.4;gcc:4.9.4"
7 "gcc-5.5.0;gcc:5.5.0"
8 "gcc-6.5.0;gcc:6.5.0"
9 "gcc-7.4.0;gcc:7.4.0"
10 "gcc-8.3.0;gcc:8.3.0"
11 "gcc-8.4.0;gcc:8.4.0"
12 "gcc-9.1.0;gcc:9.1.0"
13 "gcc-9.2.0;gcc:9.2.0"
14 "gcc-9.3.0;gcc:9.3.0"
15 "gcc-10.1.0;gcc:10.1.0"
16 "gcc-10.2.0;gcc:10.2.0"
17 "gcc-10.3.0;gcc:10.3.0"
18 "gcc-11.1.0;gcc:11.1.0"
19 "gcc-11.2.0;gcc:11.2.0"
20 # "clang-3.6.1;debian:buster"
21 # "clang-3.6.2;debian:buster"
22 # "clang-3.7.0;debian:buster"
23 # "clang-3.7.1;debian:buster"
24 # "clang-3.8.1;debian:buster"
25 # "clang-3.9.0;debian:buster"
26 # "clang-3.9.1;debian:buster"
27 # "clang-4.0.0;debian:buster"
28 # "clang-4.0.1;debian:buster"
29 # "clang-5.0.0;debian:buster"
30 # "clang-5.0.1;debian:buster"
31 "clang-5.0.2;debian:buster"
32 "clang-6.0.0;debian:buster"
33 # "clang-6.0.1;debian:buster"
34 # "clang-7.0.0;debian:buster"
35 # "clang-7.0.1;debian:buster"
36 "clang-7.1.0;debian:buster"
37 "clang-8.0.0;debian:buster"
38 "clang-9.0.0;debian:buster"
39 "clang-10.0.0;debian:buster"
40 "clang-11.0.0;ubuntu:20.04"
41 "clang-12.0.0;ubuntu:20.04"
44 name=marnav
45 account=mariokonrad/
47 function build_image()
49 compiler=$1
50 base_image=$2
51 compiler_name=${compiler%-*}
52 compiler_version=${compiler#${compiler_name}-}
54 docker build \
55 --force-rm \
56 --build-arg compiler_version=${compiler_version} \
57 --build-arg base_image=${base_image} \
58 --tag ${account}${name}:${compiler} \
59 --file ${SCRIPT_BASE}/docker/Dockerfile.${compiler_name} \
60 ${SCRIPT_BASE}/docker
63 function usage()
65 echo "usage: $(basename $0) compiler"
66 echo ""
67 echo " supported compilers:"
68 for v in ${supported_compilers[@]} ; do
69 IFS=";" read -r -a vec <<< "${v}"
70 local comp="${vec[0]}"
71 local dist="${vec[1]}"
73 echo " - ${comp} (${dist})"
74 done
75 echo ""
78 if [ $# -ne 1 ] ; then
79 usage
80 exit 1
83 for v in ${supported_compilers[@]} ; do
84 IFS=";" read -r -a vec <<< "${v}"
85 comp="${vec[0]}"
86 dist="${vec[1]}"
88 if [ "${comp}" == "$1" ] ; then
89 build_image ${comp} ${dist}
90 exit 0
92 done
93 echo "error: specified compiler not supported: $1"
94 exit 1