From 5055b15658ffa73ac686adad8a9f4ddca8ae4e06 Mon Sep 17 00:00:00 2001 From: Laurent Goderre Date: Mon, 27 Aug 2018 16:18:23 -0400 Subject: [PATCH 1/2] Use the same template for debian variants --- ...sie.template => Dockerfile-debian.template | 2 +- Dockerfile-stretch.template | 54 ------------------- config | 1 + functions.sh | 14 +++++ update.sh | 10 +++- 5 files changed, 25 insertions(+), 56 deletions(-) rename Dockerfile-jessie.template => Dockerfile-debian.template (98%) delete mode 100644 Dockerfile-stretch.template diff --git a/Dockerfile-jessie.template b/Dockerfile-debian.template similarity index 98% rename from Dockerfile-jessie.template rename to Dockerfile-debian.template index f5a638bb4..425b982f2 100644 --- a/Dockerfile-jessie.template +++ b/Dockerfile-debian.template @@ -1,4 +1,4 @@ -FROM buildpack-deps:jessie +FROM buildpack-deps:name RUN groupadd --gid 1000 node \ && useradd --uid 1000 --gid node --shell /bin/bash --create-home node diff --git a/Dockerfile-stretch.template b/Dockerfile-stretch.template deleted file mode 100644 index 149d1b261..000000000 --- a/Dockerfile-stretch.template +++ /dev/null @@ -1,54 +0,0 @@ -FROM buildpack-deps:stretch - -RUN groupadd --gid 1000 node \ - && useradd --uid 1000 --gid node --shell /bin/bash --create-home node - -ENV NODE_VERSION 0.0.0 - -RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \ - && case "${dpkgArch##*-}" in \ - amd64) ARCH='x64';; \ - ppc64el) ARCH='ppc64le';; \ - s390x) ARCH='s390x';; \ - arm64) ARCH='arm64';; \ - armhf) ARCH='armv7l';; \ - i386) ARCH='x86';; \ - *) echo "unsupported architecture"; exit 1 ;; \ - esac \ - # gpg keys listed at https://github.com/nodejs/node#release-keys - && set -ex \ - && for key in \ - "${NODE_KEYS[@]}" - ; do \ - gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" || \ - gpg --batch --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \ - gpg --batch --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \ - done \ - && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \ - && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \ - && gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \ - && grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \ - && tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \ - && rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \ - && ln -s /usr/local/bin/node /usr/local/bin/nodejs - -ENV YARN_VERSION 0.0.0 - -RUN set -ex \ - && for key in \ - "${YARN_KEYS[@]}" - ; do \ - gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" || \ - gpg --batch --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \ - gpg --batch --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \ - done \ - && curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \ - && curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \ - && gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ - && mkdir -p /opt \ - && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \ - && ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \ - && ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \ - && rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz - -CMD [ "node" ] diff --git a/config b/config index 07517578c..6a3cbd6ca 100644 --- a/config +++ b/config @@ -1,3 +1,4 @@ baseuri https://nodejs.org/dist default_variant stretch alpine_version 3.8 +debian_versions jessie stretch diff --git a/functions.sh b/functions.sh index 70f78a6ca..40de9345c 100755 --- a/functions.sh +++ b/functions.sh @@ -169,6 +169,20 @@ function get_versions() { fi } +function is_debian() { + local variant + variant=$1 + shift + + IFS=' ' read -ra debianVersions <<< "$(get_config "./" "debian_versions")" + for d in "${debianVersions[@]}"; do + if [ "${d}" = "${variant}" ]; then + return 0 + fi + done + return 1 +} + function get_fork_name() { local version version=$1 diff --git a/update.sh b/update.sh index 2b25ce59c..3c4d0b0fe 100755 --- a/update.sh +++ b/update.sh @@ -168,6 +168,8 @@ function update_node_version() { alpine_version=$(grep "FROM" "${dockerfile}" | cut -d':' -f2) fi sed -Ei -e "s/(alpine:)0.0/\\1${alpine_version}/" "${dockerfile}-tmp" + elif is_debian "${variant}"; then + sed -Ei -e "s/(buildpack-deps:)name/\\1${variant}/" "${dockerfile}-tmp" fi # Required for POSIX sed @@ -225,9 +227,15 @@ for version in "${versions[@]}"; do [ true = "$TRAVIS_CI_ONLY" ] && continue update_variant=$(in_variants_to_update "${variant}") + template_file="${parentpath}/Dockerfile-${variant}.template" + + + if is_debian "${variant}"; then + template_file="${parentpath}/Dockerfile-debian.template" + fi if [ "${update_version}" -eq 0 ] && [ "${update_variant}" -eq 0 ]; then - update_node_version "${baseuri}" "${versionnum}" "${parentpath}/Dockerfile-${variant}.template" "${version}/${variant}/Dockerfile" "${variant}" & + update_node_version "${baseuri}" "${versionnum}" "${template_file}" "${version}/${variant}/Dockerfile" "${variant}" & fi done done From fb54d5ff5f1717b5e4f85b59b7a914c87204c7e9 Mon Sep 17 00:00:00 2001 From: Laurent Goderre Date: Mon, 27 Aug 2018 16:26:59 -0400 Subject: [PATCH 2/2] Added support for multiple slim versions of debian --- .travis.yml | 34 ++++++++++---- 10/architectures | 4 +- 10/{slim => jessie-slim}/Dockerfile | 0 10/stretch-slim/Dockerfile | 66 ++++++++++++++++++++++++++++ 11/{slim => stretch-slim}/Dockerfile | 0 6/architectures | 6 +-- 6/{slim => jessie-slim}/Dockerfile | 0 6/onbuild/Dockerfile | 2 +- 6/stretch-slim/Dockerfile | 66 ++++++++++++++++++++++++++++ 8/architectures | 12 ++--- 8/jessie-slim/Dockerfile | 66 ++++++++++++++++++++++++++++ 8/{slim => stretch-slim}/Dockerfile | 0 Dockerfile-slim.template | 2 +- architectures | 10 ++--- functions.sh | 14 ++++++ generate-stackbrew-library.sh | 3 ++ update.sh | 5 ++- 17 files changed, 263 insertions(+), 27 deletions(-) rename 10/{slim => jessie-slim}/Dockerfile (100%) create mode 100644 10/stretch-slim/Dockerfile rename 11/{slim => stretch-slim}/Dockerfile (100%) rename 6/{slim => jessie-slim}/Dockerfile (100%) create mode 100644 6/stretch-slim/Dockerfile create mode 100644 8/jessie-slim/Dockerfile rename 8/{slim => stretch-slim}/Dockerfile (100%) diff --git a/.travis.yml b/.travis.yml index 829bdf0cb..5f072e348 100644 --- a/.travis.yml +++ b/.travis.yml @@ -114,13 +114,13 @@ jobs: before_script: *auto_skip env: - NODE_VERSION: "10" - - VARIANT: "alpine" + - VARIANT: "jessie-slim" - stage: Build before_script: *auto_skip env: - NODE_VERSION: "10" - - VARIANT: "slim" + - VARIANT: "alpine" - stage: Build before_script: *auto_skip @@ -128,6 +128,12 @@ jobs: - NODE_VERSION: "10" - VARIANT: "stretch" + - stage: Build + before_script: *auto_skip + env: + - NODE_VERSION: "10" + - VARIANT: "stretch-slim" + - stage: Build before_script: *auto_skip env: @@ -138,13 +144,13 @@ jobs: before_script: *auto_skip env: - NODE_VERSION: "11" - - VARIANT: "slim" + - VARIANT: "stretch" - stage: Build before_script: *auto_skip env: - NODE_VERSION: "11" - - VARIANT: "stretch" + - VARIANT: "stretch-slim" - stage: Build before_script: *auto_skip @@ -152,6 +158,12 @@ jobs: - NODE_VERSION: "6" - VARIANT: "jessie" + - stage: Build + before_script: *auto_skip + env: + - NODE_VERSION: "6" + - VARIANT: "jessie-slim" + - stage: Build before_script: *auto_skip env: @@ -168,13 +180,13 @@ jobs: before_script: *auto_skip env: - NODE_VERSION: "6" - - VARIANT: "slim" + - VARIANT: "stretch" - stage: Build before_script: *auto_skip env: - NODE_VERSION: "6" - - VARIANT: "stretch" + - VARIANT: "stretch-slim" - stage: Build before_script: *auto_skip @@ -182,6 +194,12 @@ jobs: - NODE_VERSION: "8" - VARIANT: "jessie" + - stage: Build + before_script: *auto_skip + env: + - NODE_VERSION: "8" + - VARIANT: "jessie-slim" + - stage: Build before_script: *auto_skip env: @@ -198,13 +216,13 @@ jobs: before_script: *auto_skip env: - NODE_VERSION: "8" - - VARIANT: "slim" + - VARIANT: "stretch" - stage: Build before_script: *auto_skip env: - NODE_VERSION: "8" - - VARIANT: "stretch" + - VARIANT: "stretch-slim" - stage: Build before_script: *auto_skip diff --git a/10/architectures b/10/architectures index 4b3c4e3cd..dff4d3459 100644 --- a/10/architectures +++ b/10/architectures @@ -1,8 +1,8 @@ bashbrew-arch variants arm32v6 alpine -arm32v7 jessie,onbuild,slim,stretch +arm32v7 jessie,jessie-slim,onbuild,stretch,stretch-slim arm64v8 alpine,onbuild,stretch -amd64 jessie,alpine,onbuild,slim,stretch +amd64 jessie,jessie-slim,alpine,onbuild,stretch,stretch-slim i386 alpine ppc64le alpine,onbuild,stretch s390x alpine,onbuild,stretch diff --git a/10/slim/Dockerfile b/10/jessie-slim/Dockerfile similarity index 100% rename from 10/slim/Dockerfile rename to 10/jessie-slim/Dockerfile diff --git a/10/stretch-slim/Dockerfile b/10/stretch-slim/Dockerfile new file mode 100644 index 000000000..c270ccd43 --- /dev/null +++ b/10/stretch-slim/Dockerfile @@ -0,0 +1,66 @@ +FROM debian:stretch-slim + +RUN groupadd --gid 1000 node \ + && useradd --uid 1000 --gid node --shell /bin/bash --create-home node + +ENV NODE_VERSION 10.14.0 + +RUN buildDeps='xz-utils' \ + && ARCH= && dpkgArch="$(dpkg --print-architecture)" \ + && case "${dpkgArch##*-}" in \ + amd64) ARCH='x64';; \ + ppc64el) ARCH='ppc64le';; \ + s390x) ARCH='s390x';; \ + arm64) ARCH='arm64';; \ + armhf) ARCH='armv7l';; \ + i386) ARCH='x86';; \ + *) echo "unsupported architecture"; exit 1 ;; \ + esac \ + && set -ex \ + && apt-get update && apt-get install -y ca-certificates curl wget gnupg dirmngr $buildDeps --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* \ + && for key in \ + 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \ + FD3A5288F042B6850C66B31F09FE44734EB7990E \ + 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \ + DD8F2338BAE7501E3DD5AC78C273792F7D83545D \ + C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \ + B9AE9905FFD7803F25714661B63B535A4C206CA9 \ + 77984A986EBC2AA786BC0F66B01FBB92821C587A \ + 8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \ + 4ED778F539E3634C779C87C6D7062848A1AB005C \ + A48C2BEE680E841632CD4E44F07496B3EB3C1762 \ + ; do \ + gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" || \ + gpg --batch --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \ + gpg --batch --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \ + done \ + && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \ + && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \ + && gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \ + && grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \ + && tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \ + && rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \ + && apt-get purge -y --auto-remove $buildDeps \ + && ln -s /usr/local/bin/node /usr/local/bin/nodejs + +ENV YARN_VERSION 1.10.1 + +RUN set -ex \ + && for key in \ + 6A010C5166006599AA17F08146C2130DFD2497F5 \ + ; do \ + gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" || \ + gpg --batch --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \ + gpg --batch --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \ + done \ + && curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \ + && curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \ + && gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ + && mkdir -p /opt \ + && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \ + && ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \ + && ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \ + && rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz + +CMD [ "node" ] diff --git a/11/slim/Dockerfile b/11/stretch-slim/Dockerfile similarity index 100% rename from 11/slim/Dockerfile rename to 11/stretch-slim/Dockerfile diff --git a/6/architectures b/6/architectures index f878f384a..264b7851e 100644 --- a/6/architectures +++ b/6/architectures @@ -1,7 +1,7 @@ bashbrew-arch variants -arm32v7 jessie,onbuild,slim,stretch +arm32v7 jessie,jessie-slim,onbuild,stretch,stretch-slim arm64v8 stretch -amd64 jessie,alpine,onbuild,slim,stretch -i386 jessie,onbuild,slim,stretch +amd64 jessie,jessie-slim,alpine,onbuild,stretch,stretch-slim +i386 jessie,jessie-slim,onbuild,stretch,stretch-slim ppc64le stretch s390x stretch diff --git a/6/slim/Dockerfile b/6/jessie-slim/Dockerfile similarity index 100% rename from 6/slim/Dockerfile rename to 6/jessie-slim/Dockerfile diff --git a/6/onbuild/Dockerfile b/6/onbuild/Dockerfile index cc0b0cf0e..269dd723b 100644 --- a/6/onbuild/Dockerfile +++ b/6/onbuild/Dockerfile @@ -1,4 +1,4 @@ -FROM node:6.15.0-jessie +FROM node:6.15.0-stretch RUN mkdir -p /usr/src/app WORKDIR /usr/src/app diff --git a/6/stretch-slim/Dockerfile b/6/stretch-slim/Dockerfile new file mode 100644 index 000000000..28563bab2 --- /dev/null +++ b/6/stretch-slim/Dockerfile @@ -0,0 +1,66 @@ +FROM debian:stretch-slim + +RUN groupadd --gid 1000 node \ + && useradd --uid 1000 --gid node --shell /bin/bash --create-home node + +ENV NODE_VERSION 6.15.0 + +RUN buildDeps='xz-utils' \ + && ARCH= && dpkgArch="$(dpkg --print-architecture)" \ + && case "${dpkgArch##*-}" in \ + amd64) ARCH='x64';; \ + ppc64el) ARCH='ppc64le';; \ + s390x) ARCH='s390x';; \ + arm64) ARCH='arm64';; \ + armhf) ARCH='armv7l';; \ + i386) ARCH='x86';; \ + *) echo "unsupported architecture"; exit 1 ;; \ + esac \ + && set -ex \ + && apt-get update && apt-get install -y ca-certificates curl wget gnupg dirmngr $buildDeps --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* \ + && for key in \ + 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \ + FD3A5288F042B6850C66B31F09FE44734EB7990E \ + 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \ + DD8F2338BAE7501E3DD5AC78C273792F7D83545D \ + C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \ + B9AE9905FFD7803F25714661B63B535A4C206CA9 \ + 77984A986EBC2AA786BC0F66B01FBB92821C587A \ + 8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \ + 4ED778F539E3634C779C87C6D7062848A1AB005C \ + A48C2BEE680E841632CD4E44F07496B3EB3C1762 \ + ; do \ + gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" || \ + gpg --batch --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \ + gpg --batch --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \ + done \ + && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \ + && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \ + && gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \ + && grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \ + && tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \ + && rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \ + && apt-get purge -y --auto-remove $buildDeps \ + && ln -s /usr/local/bin/node /usr/local/bin/nodejs + +ENV YARN_VERSION 1.6.0 + +RUN set -ex \ + && for key in \ + 6A010C5166006599AA17F08146C2130DFD2497F5 \ + ; do \ + gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" || \ + gpg --batch --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \ + gpg --batch --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \ + done \ + && curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \ + && curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \ + && gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ + && mkdir -p /opt \ + && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \ + && ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \ + && ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \ + && rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz + +CMD [ "node" ] diff --git a/8/architectures b/8/architectures index bbad436cd..62711562a 100644 --- a/8/architectures +++ b/8/architectures @@ -1,8 +1,8 @@ bashbrew-arch variants arm32v6 alpine -arm32v7 jessie,onbuild,slim,stretch -arm64v8 alpine,onbuild,slim,stretch -amd64 jessie,alpine,onbuild,slim,stretch -i386 jessie,alpine,onbuild,slim,stretch -ppc64le alpine,onbuild,slim,stretch -s390x alpine,onbuild,slim,stretch +arm32v7 jessie,jessie-slim,onbuild,stretch,stretch-slim +arm64v8 alpine,onbuild,stretch,stretch-slim +amd64 jessie,jessie-slim,alpine,onbuild,stretch,stretch-slim +i386 jessie,jessie-slim,alpine,onbuild,stretch,stretch-slim +ppc64le alpine,onbuild,stretch,stretch-slim +s390x alpine,onbuild,stretch,stretch-slim diff --git a/8/jessie-slim/Dockerfile b/8/jessie-slim/Dockerfile new file mode 100644 index 000000000..4d778f464 --- /dev/null +++ b/8/jessie-slim/Dockerfile @@ -0,0 +1,66 @@ +FROM debian:jessie-slim + +RUN groupadd --gid 1000 node \ + && useradd --uid 1000 --gid node --shell /bin/bash --create-home node + +ENV NODE_VERSION 8.14.0 + +RUN buildDeps='xz-utils' \ + && ARCH= && dpkgArch="$(dpkg --print-architecture)" \ + && case "${dpkgArch##*-}" in \ + amd64) ARCH='x64';; \ + ppc64el) ARCH='ppc64le';; \ + s390x) ARCH='s390x';; \ + arm64) ARCH='arm64';; \ + armhf) ARCH='armv7l';; \ + i386) ARCH='x86';; \ + *) echo "unsupported architecture"; exit 1 ;; \ + esac \ + && set -ex \ + && apt-get update && apt-get install -y ca-certificates curl wget gnupg dirmngr $buildDeps --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* \ + && for key in \ + 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \ + FD3A5288F042B6850C66B31F09FE44734EB7990E \ + 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \ + DD8F2338BAE7501E3DD5AC78C273792F7D83545D \ + C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \ + B9AE9905FFD7803F25714661B63B535A4C206CA9 \ + 77984A986EBC2AA786BC0F66B01FBB92821C587A \ + 8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \ + 4ED778F539E3634C779C87C6D7062848A1AB005C \ + A48C2BEE680E841632CD4E44F07496B3EB3C1762 \ + ; do \ + gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" || \ + gpg --batch --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \ + gpg --batch --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \ + done \ + && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \ + && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \ + && gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \ + && grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \ + && tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \ + && rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \ + && apt-get purge -y --auto-remove $buildDeps \ + && ln -s /usr/local/bin/node /usr/local/bin/nodejs + +ENV YARN_VERSION 1.12.3 + +RUN set -ex \ + && for key in \ + 6A010C5166006599AA17F08146C2130DFD2497F5 \ + ; do \ + gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" || \ + gpg --batch --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \ + gpg --batch --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \ + done \ + && curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \ + && curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \ + && gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ + && mkdir -p /opt \ + && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \ + && ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \ + && ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \ + && rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz + +CMD [ "node" ] diff --git a/8/slim/Dockerfile b/8/stretch-slim/Dockerfile similarity index 100% rename from 8/slim/Dockerfile rename to 8/stretch-slim/Dockerfile diff --git a/Dockerfile-slim.template b/Dockerfile-slim.template index 5fc343b54..bed6237ca 100644 --- a/Dockerfile-slim.template +++ b/Dockerfile-slim.template @@ -1,4 +1,4 @@ -FROM debian:stretch-slim +FROM debian:name-slim RUN groupadd --gid 1000 node \ && useradd --uid 1000 --gid node --shell /bin/bash --create-home node diff --git a/architectures b/architectures index 61e48194d..d66692de5 100644 --- a/architectures +++ b/architectures @@ -1,8 +1,8 @@ bashbrew-arch variants arm32v6 alpine -arm32v7 jessie,onbuild,slim,stretch -arm64v8 alpine,onbuild,slim,stretch -amd64 jessie,alpine,onbuild,slim,stretch +arm32v7 jessie,jessie-slim,onbuild,stretch,stretch-slim +arm64v8 alpine,onbuild,stretch,stretch-slim +amd64 jessie,jessie-slim,alpine,onbuild,stretch,stretch-slim i386 alpine -ppc64le alpine,onbuild,slim,stretch -s390x alpine,onbuild,slim,stretch +ppc64le alpine,onbuild,stretch,stretch-slim +s390x alpine,onbuild,stretch,stretch-slim diff --git a/functions.sh b/functions.sh index 40de9345c..203b08a0e 100755 --- a/functions.sh +++ b/functions.sh @@ -183,6 +183,20 @@ function is_debian() { return 1 } +function is_debian_slim() { + local variant + variant=$1 + shift + + IFS=' ' read -ra debianVersions <<< "$(get_config "./" "debian_versions")" + for d in "${debianVersions[@]}"; do + if [ "${d}-slim" = "${variant}" ]; then + return 0 + fi + done + return 1 +} + function get_fork_name() { local version version=$1 diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index f549c4b03..32015cc6c 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -91,6 +91,9 @@ for version in "${versions[@]}"; do slash='/' variantAliases=("${versionAliases[@]/%/-${variant//${slash}/-}}") + if [ "${variant}" = "${default_variant}-slim" ]; then + variantAliases+=("${versionAliases[@]/%/-slim}") + fi variantAliases=("${variantAliases[@]//latest-/}") if [ "${variant}" = "${default_variant}" ]; then variantAliases+=("${versionAliases[@]}") diff --git a/update.sh b/update.sh index 3c4d0b0fe..992a61728 100755 --- a/update.sh +++ b/update.sh @@ -170,6 +170,8 @@ function update_node_version() { sed -Ei -e "s/(alpine:)0.0/\\1${alpine_version}/" "${dockerfile}-tmp" elif is_debian "${variant}"; then sed -Ei -e "s/(buildpack-deps:)name/\\1${variant}/" "${dockerfile}-tmp" + elif is_debian_slim "${variant}"; then + sed -Ei -e "s/(debian:)name-slim/\\1${variant}/" "${dockerfile}-tmp" fi # Required for POSIX sed @@ -229,9 +231,10 @@ for version in "${versions[@]}"; do update_variant=$(in_variants_to_update "${variant}") template_file="${parentpath}/Dockerfile-${variant}.template" - if is_debian "${variant}"; then template_file="${parentpath}/Dockerfile-debian.template" + elif is_debian_slim "${variant}"; then + template_file="${parentpath}/Dockerfile-slim.template" fi if [ "${update_version}" -eq 0 ] && [ "${update_variant}" -eq 0 ]; then