forked from rethinkdb/rethinkdb-dockerfiles
-
Notifications
You must be signed in to change notification settings - Fork 4
/
generate_dockerfile.sh
executable file
·21 lines (18 loc) · 857 Bytes
/
generate_dockerfile.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
# re-generate Dockerfile for requested distribution(s)
dists=( ubuntu:trusty ubuntu:utopic debian:wheezy debian:jessie )
versions=( 1.15.1 1.15.2 1.15.3 1.16.0 1.16.1 1.16.2 1.16.3 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.1.0 2.1.1 2.1.3 2.1.4 2.1.5 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4)
DOCKERFILE_TEMPLATE=Dockerfile.tpl
for dist in ${dists[@]}; do
vendor=${dist%:*}
release=${dist#*:}
test -d $vendor || mkdir $vendor
test -d $vendor/$release || mkdir $vendor/$release
for version in ${versions[@]}; do
test -d $vendor/$release/$version || mkdir $vendor/$release/$version
sed "/^ENV RETHINKDB_PACKAGE_VERSION/s/%version%/${version}/g;
/^FROM/s/%dist%/${vendor}/g;
s/%release%/${release}/g" $DOCKERFILE_TEMPLATE > $vendor/$release/$version/Dockerfile
cp ./docker-entrypoint.sh $vendor/$release/$version/
done
done