forked from docker-library/buildpack-deps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.sh
executable file
·43 lines (40 loc) · 1.17 KB
/
update.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
#!/bin/bash
set -eo pipefail
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
versions=( "$@" )
if [ ${#versions[@]} -eq 0 ]; then
versions=( */ )
fi
versions=( "${versions[@]%/}" )
for version in "${versions[@]}"; do
if bashbrew list "https://github.com/docker-library/official-images/raw/master/library/debian:$version" &> /dev/null; then
dist='debian'
elif bashbrew list "https://github.com/docker-library/official-images/raw/master/library/ubuntu:$version" &> /dev/null; then
dist='ubuntu'
else
echo >&2 "error: cannot determine repo for '$version'"
exit 1
fi
echo "$version: $dist"
for variant in curl scm ''; do
src="Dockerfile${variant:+-$variant}.template"
trg="$version${variant:+/$variant}/Dockerfile"
mkdir -p "$(dirname "$trg")"
sed \
-e 's!DIST!'"$dist"'!g' \
-e 's!SUITE!'"$version"'!g' \
"$src" > "$trg"
if [ "$dist" = 'debian' ]; then
# remove "bzr" from buster and later
case "$version" in
jessie|stretch) echo ' - how bizarre (still includes "bzr")' ;;
*)
sed -i '/bzr/d' "$version/scm/Dockerfile"
;;
esac
if [ "$version" = 'jessie' ]; then
sed -i '/libmaxminddb-dev/d' "$version/Dockerfile"
fi
fi
done
done