Simplify the management of alpine version

Standardizes the alpine version to use and helps upgrade the alpine version only on version update
This commit is contained in:
Laurent Goderre 2018-05-17 14:06:58 -04:00
parent 4166cc4894
commit 9bd00c484c
3 changed files with 6 additions and 6 deletions

View File

@ -1,4 +1,4 @@
FROM alpine:3.4 FROM alpine:0.0
ENV NODE_VERSION 0.0.0 ENV NODE_VERSION 0.0.0

1
config
View File

@ -1 +1,2 @@
baseuri https://nodejs.org/dist baseuri https://nodejs.org/dist
alpine_version 3.7

View File

@ -42,7 +42,7 @@ function update_node_version() {
shift shift
local dockerfile=$1 local dockerfile=$1
shift shift
local variant local variant=""
if [ $# -eq 1 ]; then if [ $# -eq 1 ]; then
variant=$1 variant=$1
shift shift
@ -73,10 +73,9 @@ function update_node_version() {
sed -Ei -e "/${pattern}/d" "${dockerfile}" sed -Ei -e "/${pattern}/d" "${dockerfile}"
done done
if [ "${version/.*/}" -ge 10 ]; then if [ "${variant}" = "alpine" ]; then
sed -Ei -e 's/FROM (.*)alpine:3.4/FROM \1alpine:3.7/' "${dockerfile}" alpine_version=$(get_config "./" "alpine_version")
elif [ "${version/.*/}" -ge 8 ] || [ "$arch" = "ppc64le" ] || [ "$arch" = "s390x" ] || [ "$arch" == "arm64" ] || [ "$arch" == "arm32v7" ]; then sed -Ei "s/(alpine:)0.0/\\1${alpine_version}/" "${dockerfile}"
sed -Ei -e 's/FROM (.*)alpine:3.4/FROM \1alpine:3.6/' "${dockerfile}"
fi fi
) )
} }