Skip to content

Commit

Permalink
Support arm32v7 architecture (nodejs#504)
Browse files Browse the repository at this point in the history
* Support arm32v7

* Fix update script for armv7

* Fix get_arch function for arm32v7

* Fix indent
  • Loading branch information
dmednis authored and SimenB committed Aug 18, 2017
1 parent f71321c commit b502aa0
Show file tree
Hide file tree
Showing 19 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions 4.8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
ppc64el) ARCH='ppc64le';; \
s390x) ARCH='s390x';; \
arm64) ARCH='arm64';; \
armhf) ARCH='armv7l';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
Expand Down
1 change: 1 addition & 0 deletions 4.8/architectures
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ bashbrew-arch variants
amd64 default,alpine,onbuild,slim,stretch,wheezy
ppc64le default,onbuild,slim,stretch
arm64v8 default,onbuild,slim,stretch
arm32v7 default,onbuild,slim,stretch
1 change: 1 addition & 0 deletions 4.8/slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ RUN buildDeps='xz-utils' \
ppc64el) ARCH='ppc64le';; \
s390x) ARCH='s390x';; \
arm64) ARCH='arm64';; \
armhf) ARCH='armv7l';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& set -x \
Expand Down
1 change: 1 addition & 0 deletions 4.8/stretch/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
ppc64el) ARCH='ppc64le';; \
s390x) ARCH='s390x';; \
arm64) ARCH='arm64';; \
armhf) ARCH='armv7l';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
Expand Down
1 change: 1 addition & 0 deletions 6.11/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
ppc64el) ARCH='ppc64le';; \
s390x) ARCH='s390x';; \
arm64) ARCH='arm64';; \
armhf) ARCH='armv7l';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
Expand Down
1 change: 1 addition & 0 deletions 6.11/slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ RUN buildDeps='xz-utils' \
ppc64el) ARCH='ppc64le';; \
s390x) ARCH='s390x';; \
arm64) ARCH='arm64';; \
armhf) ARCH='armv7l';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& set -x \
Expand Down
1 change: 1 addition & 0 deletions 6.11/stretch/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
ppc64el) ARCH='ppc64le';; \
s390x) ARCH='s390x';; \
arm64) ARCH='arm64';; \
armhf) ARCH='armv7l';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
Expand Down
1 change: 1 addition & 0 deletions 7.10/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
ppc64el) ARCH='ppc64le';; \
s390x) ARCH='s390x';; \
arm64) ARCH='arm64';; \
armhf) ARCH='armv7l';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
Expand Down
1 change: 1 addition & 0 deletions 7.10/slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ RUN buildDeps='xz-utils' \
ppc64el) ARCH='ppc64le';; \
s390x) ARCH='s390x';; \
arm64) ARCH='arm64';; \
armhf) ARCH='armv7l';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& set -x \
Expand Down
1 change: 1 addition & 0 deletions 7.10/stretch/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
ppc64el) ARCH='ppc64le';; \
s390x) ARCH='s390x';; \
arm64) ARCH='arm64';; \
armhf) ARCH='armv7l';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
Expand Down
1 change: 1 addition & 0 deletions 8.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
ppc64el) ARCH='ppc64le';; \
s390x) ARCH='s390x';; \
arm64) ARCH='arm64';; \
armhf) ARCH='armv7l';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
Expand Down
1 change: 1 addition & 0 deletions 8.4/slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ RUN buildDeps='xz-utils' \
ppc64el) ARCH='ppc64le';; \
s390x) ARCH='s390x';; \
arm64) ARCH='arm64';; \
armhf) ARCH='armv7l';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& set -x \
Expand Down
1 change: 1 addition & 0 deletions 8.4/stretch/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
ppc64el) ARCH='ppc64le';; \
s390x) ARCH='s390x';; \
arm64) ARCH='arm64';; \
armhf) ARCH='armv7l';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
Expand Down
1 change: 1 addition & 0 deletions Dockerfile-slim.template
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ RUN buildDeps='xz-utils' \
ppc64el) ARCH='ppc64le';; \
s390x) ARCH='s390x';; \
arm64) ARCH='arm64';; \
armhf) ARCH='armv7l';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& set -x \
Expand Down
1 change: 1 addition & 0 deletions Dockerfile-stretch.template
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
ppc64el) ARCH='ppc64le';; \
s390x) ARCH='s390x';; \
arm64) ARCH='arm64';; \
armhf) ARCH='armv7l';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
Expand Down
1 change: 1 addition & 0 deletions Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
ppc64el) ARCH='ppc64le';; \
s390x) ARCH='s390x';; \
arm64) ARCH='arm64';; \
armhf) ARCH='armv7l';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
Expand Down
1 change: 1 addition & 0 deletions architectures
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ amd64 default,alpine,onbuild,slim,stretch,wheezy
ppc64le default,onbuild,slim,stretch
s390x default,onbuild,slim,stretch
arm64v8 default,onbuild,slim,stretch
arm32v7 default,onbuild,slim,stretch
5 changes: 4 additions & 1 deletion functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ function get_arch() {
arch="s390x"
;;
aarch64)
arch="arm64"
arch="arm64"
;;
armv7l)
arch="arm32v7"
;;
*)
echo "$0 does not support architecture $arch ... aborting"
Expand Down
2 changes: 1 addition & 1 deletion update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" || "$arch" = "arm64" ]]; then
if [[ "${version/.*/}" -ge 8 || "$arch" = "ppc64le" || "$arch" = "s390x" || "$arch" = "arm64" || "$arch" = "arm32v7" ]]; then
sed -E -i.bak 's/FROM (.*)alpine:3.4/FROM \1alpine:3.6/' "$dockerfile"
rm "$dockerfile.bak"
fi
Expand Down

0 comments on commit b502aa0

Please sign in to comment.