From 35dbf01b344f08903574c39ce69866e2e7cb11af Mon Sep 17 00:00:00 2001 From: longquan7 Date: Mon, 14 Aug 2017 20:15:40 +0800 Subject: [PATCH] Support arm64 architecture (#497) * master * Regenerate dockerfiles to update case statements * Update architectures --- 4.8/Dockerfile | 1 + 4.8/stretch/Dockerfile | 1 + 6.11/Dockerfile | 1 + 6.11/stretch/Dockerfile | 1 + 7.10/Dockerfile | 1 + 7.10/stretch/Dockerfile | 1 + 8.3/Dockerfile | 1 + 8.3/stretch/Dockerfile | 1 + Dockerfile-stretch.template | 1 + Dockerfile.template | 1 + architectures | 1 + functions.sh | 3 +++ update.sh | 2 +- 13 files changed, 15 insertions(+), 1 deletion(-) diff --git a/4.8/Dockerfile b/4.8/Dockerfile index 2645704e..504a6f1b 100644 --- a/4.8/Dockerfile +++ b/4.8/Dockerfile @@ -28,6 +28,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \ amd64) ARCH='x64';; \ ppc64el) ARCH='ppc64le';; \ s390x) ARCH='s390x';; \ + arm64) ARCH='arm64';; \ *) echo "unsupported architecture"; exit 1 ;; \ esac \ && curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \ diff --git a/4.8/stretch/Dockerfile b/4.8/stretch/Dockerfile index 03c72d60..eec16af3 100644 --- a/4.8/stretch/Dockerfile +++ b/4.8/stretch/Dockerfile @@ -28,6 +28,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \ amd64) ARCH='x64';; \ ppc64el) ARCH='ppc64le';; \ s390x) ARCH='s390x';; \ + arm64) ARCH='arm64';; \ *) echo "unsupported architecture"; exit 1 ;; \ esac \ && curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \ diff --git a/6.11/Dockerfile b/6.11/Dockerfile index b3e4908a..7b14f142 100644 --- a/6.11/Dockerfile +++ b/6.11/Dockerfile @@ -28,6 +28,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \ amd64) ARCH='x64';; \ ppc64el) ARCH='ppc64le';; \ s390x) ARCH='s390x';; \ + arm64) ARCH='arm64';; \ *) echo "unsupported architecture"; exit 1 ;; \ esac \ && curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \ diff --git a/6.11/stretch/Dockerfile b/6.11/stretch/Dockerfile index 3300680c..a06f30c6 100644 --- a/6.11/stretch/Dockerfile +++ b/6.11/stretch/Dockerfile @@ -28,6 +28,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \ amd64) ARCH='x64';; \ ppc64el) ARCH='ppc64le';; \ s390x) ARCH='s390x';; \ + arm64) ARCH='arm64';; \ *) echo "unsupported architecture"; exit 1 ;; \ esac \ && curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \ diff --git a/7.10/Dockerfile b/7.10/Dockerfile index 8cef8579..517dde00 100644 --- a/7.10/Dockerfile +++ b/7.10/Dockerfile @@ -28,6 +28,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \ amd64) ARCH='x64';; \ ppc64el) ARCH='ppc64le';; \ s390x) ARCH='s390x';; \ + arm64) ARCH='arm64';; \ *) echo "unsupported architecture"; exit 1 ;; \ esac \ && curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \ diff --git a/7.10/stretch/Dockerfile b/7.10/stretch/Dockerfile index ea03809a..dc853424 100644 --- a/7.10/stretch/Dockerfile +++ b/7.10/stretch/Dockerfile @@ -28,6 +28,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \ amd64) ARCH='x64';; \ ppc64el) ARCH='ppc64le';; \ s390x) ARCH='s390x';; \ + arm64) ARCH='arm64';; \ *) echo "unsupported architecture"; exit 1 ;; \ esac \ && curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \ diff --git a/8.3/Dockerfile b/8.3/Dockerfile index 3fe711cb..69249c5d 100644 --- a/8.3/Dockerfile +++ b/8.3/Dockerfile @@ -28,6 +28,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \ amd64) ARCH='x64';; \ ppc64el) ARCH='ppc64le';; \ s390x) ARCH='s390x';; \ + arm64) ARCH='arm64';; \ *) echo "unsupported architecture"; exit 1 ;; \ esac \ && curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \ diff --git a/8.3/stretch/Dockerfile b/8.3/stretch/Dockerfile index d59a06a0..e808d9f3 100644 --- a/8.3/stretch/Dockerfile +++ b/8.3/stretch/Dockerfile @@ -28,6 +28,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \ amd64) ARCH='x64';; \ ppc64el) ARCH='ppc64le';; \ s390x) ARCH='s390x';; \ + arm64) ARCH='arm64';; \ *) echo "unsupported architecture"; exit 1 ;; \ esac \ && curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \ diff --git a/Dockerfile-stretch.template b/Dockerfile-stretch.template index 17ba230d..5dfc24bd 100644 --- a/Dockerfile-stretch.template +++ b/Dockerfile-stretch.template @@ -28,6 +28,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \ amd64) ARCH='x64';; \ ppc64el) ARCH='ppc64le';; \ s390x) ARCH='s390x';; \ + arm64) ARCH='arm64';; \ *) echo "unsupported architecture"; exit 1 ;; \ esac \ && curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \ diff --git a/Dockerfile.template b/Dockerfile.template index a887be17..f536455d 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -28,6 +28,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \ amd64) ARCH='x64';; \ ppc64el) ARCH='ppc64le';; \ s390x) ARCH='s390x';; \ + arm64) ARCH='arm64';; \ *) echo "unsupported architecture"; exit 1 ;; \ esac \ && curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \ diff --git a/architectures b/architectures index 1d4ef927..57d81231 100644 --- a/architectures +++ b/architectures @@ -2,3 +2,4 @@ bashbrew-arch variants amd64 default,alpine,onbuild,slim,stretch,wheezy ppc64le default,onbuild,slim,stretch s390x default,onbuild,slim,stretch +arm64v8 default,onbuild,slim,stretch diff --git a/functions.sh b/functions.sh index 51926c93..0c6835e6 100755 --- a/functions.sh +++ b/functions.sh @@ -19,6 +19,9 @@ function get_arch() { s390x) arch="s390x" ;; + aarch64) + arch="arm64" + ;; *) echo "$0 does not support architecture $arch ... aborting" exit 1 diff --git a/update.sh b/update.sh index f695b2ea..f8506ef4 100755 --- a/update.sh +++ b/update.sh @@ -42,7 +42,7 @@ function update_node_version { sed -E -i.bak 's/^FROM (.*)/FROM '"$fromprefix"'\1/' "$dockerfile" && rm "$dockerfile".bak sed -E -i.bak 's/^(ENV NODE_VERSION |FROM .*node:).*/\1'"$version.$fullVersion"'/' "$dockerfile" && rm "$dockerfile".bak sed -E -i.bak 's/^(ENV YARN_VERSION ).*/\1'"$yarnVersion"'/' "$dockerfile" && rm "$dockerfile".bak - if [[ "${version/.*/}" -ge 8 || "$arch" = "ppc64le" || "$arch" = "s390x" ]]; then + if [[ "${version/.*/}" -ge 8 || "$arch" = "ppc64le" || "$arch" = "s390x" || "$arch" = "arm64" ]]; then sed -E -i.bak 's/FROM (.*)alpine:3.4/FROM \1alpine:3.6/' "$dockerfile" rm "$dockerfile.bak" fi