From 9bd00c484c2c22b48d641fd44d7fcb7b9ffc8d52 Mon Sep 17 00:00:00 2001 From: Laurent Goderre Date: Thu, 17 May 2018 14:06:58 -0400 Subject: [PATCH] Simplify the management of alpine version Standardizes the alpine version to use and helps upgrade the alpine version only on version update --- Dockerfile-alpine.template | 2 +- config | 1 + update.sh | 9 ++++----- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 94f2fad2b9..69f932c196 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -1,4 +1,4 @@ -FROM alpine:3.4 +FROM alpine:0.0 ENV NODE_VERSION 0.0.0 diff --git a/config b/config index 31f0b8a992..5b8db12664 100644 --- a/config +++ b/config @@ -1 +1,2 @@ baseuri https://nodejs.org/dist +alpine_version 3.7 diff --git a/update.sh b/update.sh index 0cb0bef356..df4ea31911 100755 --- a/update.sh +++ b/update.sh @@ -42,7 +42,7 @@ function update_node_version() { shift local dockerfile=$1 shift - local variant + local variant="" if [ $# -eq 1 ]; then variant=$1 shift @@ -73,10 +73,9 @@ function update_node_version() { sed -Ei -e "/${pattern}/d" "${dockerfile}" done - if [ "${version/.*/}" -ge 10 ]; then - sed -Ei -e 's/FROM (.*)alpine:3.4/FROM \1alpine:3.7/' "${dockerfile}" - elif [ "${version/.*/}" -ge 8 ] || [ "$arch" = "ppc64le" ] || [ "$arch" = "s390x" ] || [ "$arch" == "arm64" ] || [ "$arch" == "arm32v7" ]; then - sed -Ei -e 's/FROM (.*)alpine:3.4/FROM \1alpine:3.6/' "${dockerfile}" + if [ "${variant}" = "alpine" ]; then + alpine_version=$(get_config "./" "alpine_version") + sed -Ei "s/(alpine:)0.0/\\1${alpine_version}/" "${dockerfile}" fi ) }