-
Notifications
You must be signed in to change notification settings - Fork 2k
Added multiple versions of alpine #1125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e3dcc61
to
5d02894
Compare
5d02894
to
b915922
Compare
Looks like the docker-entrypoint.sh execution permission changed from executable |
I think there should probably be a plain "alpine" alias, but I'm not sure what image it should point to |
@nschonni the |
b915922
to
ec736f3
Compare
ec736f3
to
426128b
Compare
@PeterDaveHello @tianon @yosifkit this is ready for final review! |
cc1abc0
to
8e59fb3
Compare
@PeterDaveHello can you review again? |
8e59fb3
to
c6bc44e
Compare
@PeterDaveHello #1142 is being applied to all the alpines now with this one. Can we merge when the build passes? |
A simpler diff for review (generated via `git diff` cli):diff --git a/.travis.yml b/.travis.yml
index 9c78b6d..0055174 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -128,13 +128,6 @@ jobs:
- NODE_VERSION="10"
- VARIANT="jessie-slim"
- - stage: Build
- before_script: *auto_skip
- name: 10 on alpine
- env:
- - NODE_VERSION="10"
- - VARIANT="alpine"
-
- stage: Build
before_script: *auto_skip
name: 10 on stretch
@@ -165,10 +158,17 @@ jobs:
- stage: Build
before_script: *auto_skip
- name: 12 on alpine
+ name: 10 on alpine3.9
env:
- - NODE_VERSION="12"
- - VARIANT="alpine"
+ - NODE_VERSION="10"
+ - VARIANT="alpine3.9"
+
+ - stage: Build
+ before_script: *auto_skip
+ name: 10 on alpine3.10
+ env:
+ - NODE_VERSION="10"
+ - VARIANT="alpine3.10"
- stage: Build
before_script: *auto_skip
@@ -200,10 +200,17 @@ jobs:
- stage: Build
before_script: *auto_skip
- name: 13 on alpine
+ name: 12 on alpine3.9
env:
- - NODE_VERSION="13"
- - VARIANT="alpine"
+ - NODE_VERSION="12"
+ - VARIANT="alpine3.9"
+
+ - stage: Build
+ before_script: *auto_skip
+ name: 12 on alpine3.10
+ env:
+ - NODE_VERSION="12"
+ - VARIANT="alpine3.10"
- stage: Build
before_script: *auto_skip
@@ -233,6 +240,13 @@ jobs:
- NODE_VERSION="13"
- VARIANT="buster-slim"
+ - stage: Build
+ before_script: *auto_skip
+ name: 13 on alpine3.10
+ env:
+ - NODE_VERSION="13"
+ - VARIANT="alpine3.10"
+
- stage: Build
before_script: *auto_skip
name: 8 on jessie
@@ -249,45 +263,45 @@ jobs:
- stage: Build
before_script: *auto_skip
- name: 8 on alpine
+ name: 8 on stretch
env:
- NODE_VERSION="8"
- - VARIANT="alpine"
+ - VARIANT="stretch"
- stage: Build
before_script: *auto_skip
- name: 8 on onbuild
+ name: 8 on stretch-slim
env:
- NODE_VERSION="8"
- - VARIANT="onbuild"
+ - VARIANT="stretch-slim"
- stage: Build
before_script: *auto_skip
- name: 8 on stretch
+ name: 8 on buster
env:
- NODE_VERSION="8"
- - VARIANT="stretch"
+ - VARIANT="buster"
- stage: Build
before_script: *auto_skip
- name: 8 on stretch-slim
+ name: 8 on buster-slim
env:
- NODE_VERSION="8"
- - VARIANT="stretch-slim"
+ - VARIANT="buster-slim"
- stage: Build
before_script: *auto_skip
- name: 8 on buster
+ name: 8 on alpine3.9
env:
- NODE_VERSION="8"
- - VARIANT="buster"
+ - VARIANT="alpine3.9"
- stage: Build
before_script: *auto_skip
- name: 8 on buster-slim
+ name: 8 on alpine3.10
env:
- NODE_VERSION="8"
- - VARIANT="buster-slim"
+ - VARIANT="alpine3.10"
- stage: Build
before_script: *auto_skip
diff --git a/10/alpine/Dockerfile b/10/alpine3.10/Dockerfile
similarity index 98%
copy from 10/alpine/Dockerfile
copy to 10/alpine3.10/Dockerfile
index 123238e..4e088fc 100644
--- a/10/alpine/Dockerfile
+++ b/10/alpine3.10/Dockerfile
@@ -1,4 +1,4 @@
-FROM alpine:3.9
+FROM alpine:3.10
ENV NODE_VERSION 10.17.0
@@ -8,7 +8,7 @@ RUN addgroup -g 1000 node \
libstdc++ \
&& apk add --no-cache --virtual .build-deps \
curl \
- && ARCH= && alpineArch="$(arch)" \
+ && ARCH= && alpineArch="$(apk --print-arch)" \
&& case "${alpineArch##*-}" in \
x86_64) \
ARCH='x64' \
diff --git a/10/alpine/docker-entrypoint.sh b/10/alpine3.10/docker-entrypoint.sh
similarity index 100%
copy from 10/alpine/docker-entrypoint.sh
copy to 10/alpine3.10/docker-entrypoint.sh
diff --git a/10/alpine/Dockerfile b/10/alpine3.9/Dockerfile
similarity index 98%
rename from 10/alpine/Dockerfile
rename to 10/alpine3.9/Dockerfile
index 123238e..7bfe8d2 100644
--- a/10/alpine/Dockerfile
+++ b/10/alpine3.9/Dockerfile
@@ -8,7 +8,7 @@ RUN addgroup -g 1000 node \
libstdc++ \
&& apk add --no-cache --virtual .build-deps \
curl \
- && ARCH= && alpineArch="$(arch)" \
+ && ARCH= && alpineArch="$(apk --print-arch)" \
&& case "${alpineArch##*-}" in \
x86_64) \
ARCH='x64' \
diff --git a/12/alpine/docker-entrypoint.sh b/10/alpine3.9/docker-entrypoint.sh
similarity index 100%
rename from 12/alpine/docker-entrypoint.sh
rename to 10/alpine3.9/docker-entrypoint.sh
diff --git a/10/architectures b/10/architectures
index 5f77c7c..162fbcb 100644
--- a/10/architectures
+++ b/10/architectures
@@ -1,8 +1,8 @@
bashbrew-arch variants
-amd64 jessie,jessie-slim,alpine,stretch,stretch-slim,buster,buster-slim
-arm32v6 alpine
-arm32v7 jessie,jessie-slim,alpine,stretch,stretch-slim,buster,buster-slim
-arm64v8 alpine,stretch,stretch-slim,buster,buster-slim
-i386 alpine
-ppc64le alpine,stretch,stretch-slim,buster,buster-slim
-s390x alpine,stretch,stretch-slim,buster,buster-slim
+amd64 jessie,jessie-slim,stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10
+arm32v6 alpine3.9,alpine3.10
+arm32v7 jessie,jessie-slim,stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10
+arm64v8 stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10
+i386 alpine3.9,alpine3.10
+ppc64le stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10
+s390x stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10
diff --git a/12/alpine/Dockerfile b/12/alpine3.10/Dockerfile
similarity index 98%
copy from 12/alpine/Dockerfile
copy to 12/alpine3.10/Dockerfile
index ae0bce7..a23bb5b 100644
--- a/12/alpine/Dockerfile
+++ b/12/alpine3.10/Dockerfile
@@ -1,4 +1,4 @@
-FROM alpine:3.9
+FROM alpine:3.10
ENV NODE_VERSION 12.13.0
@@ -8,7 +8,7 @@ RUN addgroup -g 1000 node \
libstdc++ \
&& apk add --no-cache --virtual .build-deps \
curl \
- && ARCH= && alpineArch="$(arch)" \
+ && ARCH= && alpineArch="$(apk --print-arch)" \
&& case "${alpineArch##*-}" in \
x86_64) \
ARCH='x64' \
diff --git a/13/alpine/docker-entrypoint.sh b/12/alpine3.10/docker-entrypoint.sh
similarity index 100%
rename from 13/alpine/docker-entrypoint.sh
rename to 12/alpine3.10/docker-entrypoint.sh
diff --git a/12/alpine/Dockerfile b/12/alpine3.9/Dockerfile
similarity index 98%
rename from 12/alpine/Dockerfile
rename to 12/alpine3.9/Dockerfile
index ae0bce7..90d90b6 100644
--- a/12/alpine/Dockerfile
+++ b/12/alpine3.9/Dockerfile
@@ -8,7 +8,7 @@ RUN addgroup -g 1000 node \
libstdc++ \
&& apk add --no-cache --virtual .build-deps \
curl \
- && ARCH= && alpineArch="$(arch)" \
+ && ARCH= && alpineArch="$(apk --print-arch)" \
&& case "${alpineArch##*-}" in \
x86_64) \
ARCH='x64' \
diff --git a/8/alpine/docker-entrypoint.sh b/12/alpine3.9/docker-entrypoint.sh
similarity index 100%
rename from 8/alpine/docker-entrypoint.sh
rename to 12/alpine3.9/docker-entrypoint.sh
diff --git a/12/architectures b/12/architectures
index 7adab03..0185a0f 100644
--- a/12/architectures
+++ b/12/architectures
@@ -1,8 +1,8 @@
bashbrew-arch variants
-amd64 alpine,stretch,stretch-slim,buster,buster-slim
-arm32v6 alpine
-arm32v7 alpine,stretch,stretch-slim,buster,buster-slim
-arm64v8 alpine,stretch,stretch-slim,buster,buster-slim
-i386 alpine
-ppc64le alpine,stretch,stretch-slim,buster,buster-slim
-s390x alpine,stretch,stretch-slim,buster,buster-slim
+amd64 stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10
+arm32v6 alpine3.9,alpine3.10
+arm32v7 stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10
+arm64v8 stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10
+i386 alpine3.9,alpine3.10
+ppc64le stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10
+s390x stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10
diff --git a/13/alpine/Dockerfile b/13/alpine3.10/Dockerfile
similarity index 100%
rename from 13/alpine/Dockerfile
rename to 13/alpine3.10/Dockerfile
diff --git a/10/alpine/docker-entrypoint.sh b/13/alpine3.10/docker-entrypoint.sh
similarity index 100%
copy from 10/alpine/docker-entrypoint.sh
copy to 13/alpine3.10/docker-entrypoint.sh
diff --git a/8/alpine/Dockerfile b/8/alpine3.10/Dockerfile
similarity index 98%
copy from 8/alpine/Dockerfile
copy to 8/alpine3.10/Dockerfile
index 1822ac3..b0b7637 100644
--- a/8/alpine/Dockerfile
+++ b/8/alpine3.10/Dockerfile
@@ -1,4 +1,4 @@
-FROM alpine:3.9
+FROM alpine:3.10
ENV NODE_VERSION 8.16.2
@@ -8,7 +8,7 @@ RUN addgroup -g 1000 node \
libstdc++ \
&& apk add --no-cache --virtual .build-deps \
curl \
- && ARCH= && alpineArch="$(arch)" \
+ && ARCH= && alpineArch="$(apk --print-arch)" \
&& case "${alpineArch##*-}" in \
x86_64) \
ARCH='x64' \
diff --git a/10/alpine/docker-entrypoint.sh b/8/alpine3.10/docker-entrypoint.sh
similarity index 100%
copy from 10/alpine/docker-entrypoint.sh
copy to 8/alpine3.10/docker-entrypoint.sh
diff --git a/8/alpine/Dockerfile b/8/alpine3.9/Dockerfile
similarity index 98%
rename from 8/alpine/Dockerfile
rename to 8/alpine3.9/Dockerfile
index 1822ac3..f9ecccd 100644
--- a/8/alpine/Dockerfile
+++ b/8/alpine3.9/Dockerfile
@@ -8,7 +8,7 @@ RUN addgroup -g 1000 node \
libstdc++ \
&& apk add --no-cache --virtual .build-deps \
curl \
- && ARCH= && alpineArch="$(arch)" \
+ && ARCH= && alpineArch="$(apk --print-arch)" \
&& case "${alpineArch##*-}" in \
x86_64) \
ARCH='x64' \
diff --git a/10/alpine/docker-entrypoint.sh b/8/alpine3.9/docker-entrypoint.sh
similarity index 100%
rename from 10/alpine/docker-entrypoint.sh
rename to 8/alpine3.9/docker-entrypoint.sh
diff --git a/8/architectures b/8/architectures
index 11c069b..39a08d8 100644
--- a/8/architectures
+++ b/8/architectures
@@ -1,8 +1,8 @@
bashbrew-arch variants
-amd64 jessie,jessie-slim,alpine,onbuild,stretch,stretch-slim,buster,buster-slim
-arm32v6 alpine
-arm32v7 jessie,jessie-slim,alpine,onbuild,stretch,stretch-slim,buster,buster-slim
-arm64v8 alpine,onbuild,stretch,stretch-slim,buster,buster-slim
-i386 jessie,jessie-slim,alpine,onbuild,stretch,stretch-slim,buster,buster-slim
-ppc64le alpine,onbuild,stretch,stretch-slim,buster,buster-slim
-s390x alpine,onbuild,stretch,stretch-slim,buster,buster-slim
+amd64 jessie,jessie-slim,stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10,onbuild
+arm32v6 alpine3.9,alpine3.10
+arm32v7 jessie,jessie-slim,stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10,onbuild
+arm64v8 stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10,onbuild
+i386 jessie,jessie-slim,alpine,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10,onbuild
+ppc64le stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10,onbuild
+s390x stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10,onbuild
diff --git a/architectures b/architectures
index 64b4164..565bbb7 100644
--- a/architectures
+++ b/architectures
@@ -1,8 +1,8 @@
bashbrew-arch variants
-amd64 jessie,jessie-slim,alpine,onbuild,stretch,stretch-slim,buster,buster-slim
-arm32v6 jessie,jessie-slim,alpine,onbuild,stretch,stretch-slim,buster,buster-slim
-arm32v7 jessie,jessie-slim,alpine,onbuild,stretch,stretch-slim,buster,buster-slim
-arm64v8 jessie,jessie-slim,alpine,onbuild,stretch,stretch-slim,buster,buster-slim
-i386 jessie,jessie-slim,alpine,onbuild,stretch,stretch-slim,buster,buster-slim
-ppc64le jessie,jessie-slim,alpine,onbuild,stretch,stretch-slim,buster,buster-slim
-s390x jessie,jessie-slim,alpine,onbuild,stretch,stretch-slim,buster,buster-slim
+amd64 jessie,jessie-slim,stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10
+arm32v6 jessie,jessie-slim,stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10
+arm32v7 jessie,jessie-slim,stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10
+arm64v8 jessie,jessie-slim,stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10
+i386 jessie,jessie-slim,stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10
+ppc64le jessie,jessie-slim,stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10
+s390x jessie,jessie-slim,stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10
diff --git a/functions.sh b/functions.sh
index 203b08a..5f37f35 100755
--- a/functions.sh
+++ b/functions.sh
@@ -169,6 +169,16 @@ function get_versions() {
fi
}
+function is_alpine() {
+ local variant
+ variant=${1}
+ shift
+
+ if [ "${variant}" = "${variant#alpine}" ]; then
+ return 1
+ fi
+}
+
function is_debian() {
local variant
variant=$1
diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh
index 5dbe1f1..a29e6e8 100755
--- a/generate-stackbrew-library.sh
+++ b/generate-stackbrew-library.sh
@@ -21,6 +21,8 @@ array_chakracore_10='chakracore-10 chakracore'
default_variant=$(get_config "./" "default_variant")
+default_alpine=$(get_config "./" "alpine_version")
+
cd "$(cd "${0%/*}" && pwd -P)"
self="$(basename "${BASH_SOURCE[0]}")"
@@ -93,11 +95,12 @@ for version in "${versions[@]}"; do
variantAliases=("${versionAliases[@]/%/-${variant//${slash}/-}}")
if [ "${variant}" = "${default_variant}-slim" ]; then
variantAliases+=("${versionAliases[@]/%/-slim}")
- fi
- variantAliases=("${variantAliases[@]//latest-/}")
- if [ "${variant}" = "${default_variant}" ]; then
+ elif [ "${variant}" = "alpine${default_alpine}" ]; then
+ variantAliases+=("${versionAliases[@]/%/-alpine}")
+ elif [ "${variant}" = "${default_variant}" ]; then
variantAliases+=("${versionAliases[@]}")
fi
+ variantAliases=("${variantAliases[@]//latest-/}")
# Get supported architectures for a specific version and variant.
# See details in function.sh
diff --git a/update.sh b/update.sh
index 6805b96..8fd0b86 100755
--- a/update.sh
+++ b/update.sh
@@ -162,16 +162,11 @@ function update_node_version() {
sed -Ei -e "/${pattern}/d" "${dockerfile}-tmp"
done
- if [ "${variant}" = "alpine" ]; then
- if [ "${SKIP}" = true ]; then
- # Get the currently used Alpine version
- alpine_version=$(grep "FROM" "${dockerfile}" | cut -d':' -f2)
- checksum=$(grep -o "CHECKSUM=\".*\"" "${dockerfile}" | cut -d'=' -f2)
- else
+ if is_alpine "${variant}"; then
+ alpine_version="${variant#*alpine}"
checksum="\"$(
curl -sSL --compressed "https://unofficial-builds.nodejs.org/download/release/v${nodeVersion}/SHASUMS256.txt" | grep "node-v${nodeVersion}-linux-x64-musl.tar.xz" | cut -d' ' -f1
)\""
- fi
sed -Ei -e "s/(alpine:)0.0/\\1${alpine_version}/" "${dockerfile}-tmp"
sed -Ei -e "s/CHECKSUM=CHECKSUM_x64/CHECKSUM=${checksum}/" "${dockerfile}-tmp"
elif is_debian "${variant}"; then
@@ -249,6 +244,8 @@ for version in "${versions[@]}"; do
template_file="${parentpath}/Dockerfile-debian.template"
elif is_debian_slim "${variant}"; then
template_file="${parentpath}/Dockerfile-slim.template"
+ elif is_alpine "${variant}"; then
+ template_file="${parentpath}/Dockerfile-alpine.template"
fi
[ "$variant" != "onbuild" ] && cp "${parentpath}/docker-entrypoint.sh" "${version}/${variant}/docker-entrypoint.sh" |
I didn't verify the |
@tianon the |
Created PR to the official-images repo (docker-library/official-images#6972) |
Mostly looks good, but it looks like the "13-alpine" tag is missing |
@rvagg you commented on my other PR being opened for 6 months but I have been working towards this change for over 2 years! |
Respect, for the stamina! |
Should wait for #1026 before merging