diff --git a/buildpack-10/Dockerfile b/buildpack-10/Dockerfile index f346dd8..0f0fee8 100644 --- a/buildpack-10/Dockerfile +++ b/buildpack-10/Dockerfile @@ -14,6 +14,7 @@ RUN set -xe && \ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \ apt-get update && \ apt-get install -y --no-install-recommends postgresql-client-12 && \ + if [ $(dpkg --print-architecture) = "arm64" ];then apt-get install -y --no-install-recommends phantomjs; fi && \ rm -rf /var/lib/apt/lists/* && \ # install node-prune npm install -g node-prune && npm cache clean --force && \ diff --git a/buildpack-14/Dockerfile b/buildpack-14/Dockerfile index 1824a97..c57ce5e 100644 --- a/buildpack-14/Dockerfile +++ b/buildpack-14/Dockerfile @@ -14,6 +14,7 @@ RUN set -xe && \ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \ apt-get update && \ apt-get install -y --no-install-recommends postgresql-client-11 && \ + if [ $(dpkg --print-architecture) = "arm64" ];then apt-get install -y --no-install-recommends phantomjs; fi && \ rm -rf /var/lib/apt/lists/* && \ # upgrade npm to 6.10 npm i -g npm@7.8.0 && npm cache clean --force && \ diff --git a/buildpack-15/Dockerfile b/buildpack-15/Dockerfile index 108ce2d..55b02b7 100644 --- a/buildpack-15/Dockerfile +++ b/buildpack-15/Dockerfile @@ -14,6 +14,7 @@ RUN set -xe && \ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \ apt-get update && \ apt-get install -y --no-install-recommends postgresql-client-11 && \ + if [ $(dpkg --print-architecture) = "arm64" ];then apt-get install -y --no-install-recommends phantomjs; fi && \ rm -rf /var/lib/apt/lists/* && \ # upgrade npm to 6.10 npm i -g npm@7.7.0 && \ diff --git a/buildpack/Dockerfile b/buildpack/Dockerfile index 4f0eff2..97960e7 100644 --- a/buildpack/Dockerfile +++ b/buildpack/Dockerfile @@ -1,4 +1,5 @@ FROM node:8.16.2-jessie +# WARNING this version can't support arm64 ENV DEBIAN_VERSION_NAME jessie diff --git a/runtime-10/Dockerfile b/runtime-10/Dockerfile index 1513be9..1202ff3 100644 --- a/runtime-10/Dockerfile +++ b/runtime-10/Dockerfile @@ -2,6 +2,7 @@ FROM node:10.20.1-buster-slim ENV DEBIAN_VERSION_NAME=buster NODE_ENV=production ENV OPENSSL_CONF=/etc/ssl/ +ENV PORTCHECKER_VERSION=v1.1.0 ARG USER_NAME=hackmd ARG UID=1500 @@ -15,12 +16,13 @@ RUN set -xe && \ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \ apt-get update && \ apt-get install -y --no-install-recommends postgresql-client-12 && \ + if [ $(dpkg --print-architecture) = "arm64" ];then apt-get install -y --no-install-recommends phantomjs; fi && \ rm -rf /var/lib/apt/lists/* && \ # install pchecker - wget https://github.com/hackmdio/portchecker/releases/download/v1.0.5/portchecker-linux-amd64.tar.gz && \ - tar xvf portchecker-linux-amd64.tar.gz -C /usr/local/bin && \ - mv /usr/local/bin/portchecker-linux-amd64 /usr/local/bin/pcheck && \ - rm portchecker-linux-amd64.tar.gz && \ + wget https://github.com/hackmdio/portchecker/releases/download/${PORTCHECKER_VERSION}/portchecker-linux-$(dpkg --print-architecture).tar.gz && \ + tar xvf portchecker-linux-$(dpkg --print-architecture).tar.gz -C /usr/local/bin && \ + mv /usr/local/bin/portchecker-linux-$(dpkg --print-architecture) /usr/local/bin/pcheck && \ + rm portchecker-linux-$(dpkg --print-architecture).tar.gz && \ # Add user and groupd groupadd --gid $GID $USER_NAME && \ useradd --uid $UID --gid $USER_NAME --no-log-init --create-home $USER_NAME && \ diff --git a/runtime-10/Dockerfile-cjk b/runtime-10/Dockerfile-cjk index 77877fa..7f2adb3 100644 --- a/runtime-10/Dockerfile-cjk +++ b/runtime-10/Dockerfile-cjk @@ -2,6 +2,7 @@ FROM node:10.20.1-buster-slim ENV DEBIAN_VERSION_NAME=buster NODE_ENV=production ENV OPENSSL_CONF=/etc/ssl/ +ENV PORTCHECKER_VERSION=v1.1.0 ARG USER_NAME=hackmd ARG UID=1500 @@ -20,12 +21,13 @@ RUN set -xe && \ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \ apt-get update && \ apt-get install -y --no-install-recommends postgresql-client-12 && \ + if [ $(dpkg --print-architecture) = "arm64" ];then apt-get install -y --no-install-recommends phantomjs; fi && \ rm -rf /var/lib/apt/lists/* && \ # install pchecker - wget https://github.com/hackmdio/portchecker/releases/download/v1.0.5/portchecker-linux-amd64.tar.gz && \ - tar xvf portchecker-linux-amd64.tar.gz -C /usr/local/bin && \ - mv /usr/local/bin/portchecker-linux-amd64 /usr/local/bin/pcheck && \ - rm portchecker-linux-amd64.tar.gz && \ + wget https://github.com/hackmdio/portchecker/releases/download/${PORTCHECKER_VERSION}/portchecker-linux-$(dpkg --print-architecture).tar.gz && \ + tar xvf portchecker-linux-$(dpkg --print-architecture).tar.gz -C /usr/local/bin && \ + mv /usr/local/bin/portchecker-linux-$(dpkg --print-architecture) /usr/local/bin/pcheck && \ + rm portchecker-linux-$(dpkg --print-architecture).tar.gz && \ # Add user and groupd groupadd --gid $GID $USER_NAME && \ useradd --uid $UID --gid $USER_NAME --no-log-init --create-home $USER_NAME && \ diff --git a/runtime-14/Dockerfile b/runtime-14/Dockerfile index c713e2f..8af32fd 100644 --- a/runtime-14/Dockerfile +++ b/runtime-14/Dockerfile @@ -1,6 +1,7 @@ FROM node:14.17.2-buster ENV DEBIAN_VERSION_NAME=buster NODE_ENV=production +ENV PORTCHECKER_VERSION=v1.1.0 ARG USER_NAME=hackmd ARG UID=1500 @@ -19,12 +20,13 @@ RUN set -xe && \ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \ apt-get update && \ apt-get install -y --no-install-recommends postgresql-client-11 && \ + if [ $(dpkg --print-architecture) = "arm64" ];then apt-get install -y --no-install-recommends phantomjs; fi && \ rm -rf /var/lib/apt/lists/* && \ # install pchecker - wget https://github.com/hackmdio/portchecker/releases/download/v1.1.0/portchecker-linux-amd64.tar.gz && \ - tar xvf portchecker-linux-amd64.tar.gz -C /usr/local/bin && \ - mv /usr/local/bin/portchecker-linux-amd64 /usr/local/bin/pcheck && \ - rm portchecker-linux-amd64.tar.gz && \ + wget https://github.com/hackmdio/portchecker/releases/download/${PORTCHECKER_VERSION}/portchecker-linux-$(dpkg --print-architecture).tar.gz && \ + tar xvf portchecker-linux-$(dpkg --print-architecture).tar.gz -C /usr/local/bin && \ + mv /usr/local/bin/portchecker-linux-$(dpkg --print-architecture) /usr/local/bin/pcheck && \ + rm portchecker-linux-$(dpkg --print-architecture).tar.gz && \ # Add user and groupd groupadd --gid $GID $USER_NAME && \ useradd --uid $UID --gid $USER_NAME --no-log-init --create-home $USER_NAME && \ diff --git a/runtime-15/Dockerfile b/runtime-15/Dockerfile index ccc2ef5..55f6577 100644 --- a/runtime-15/Dockerfile +++ b/runtime-15/Dockerfile @@ -1,6 +1,7 @@ FROM node:15.12.0-buster ENV DEBIAN_VERSION_NAME=jessie NODE_ENV=production +ENV PORTCHECKER_VERSION=v1.1.0 ARG USER_NAME=hackmd ARG UID=1500 @@ -19,12 +20,13 @@ RUN set -xe && \ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \ apt-get update && \ apt-get install -y --no-install-recommends postgresql-client-11 && \ + if [ $(dpkg --print-architecture) = "arm64" ];then apt-get install -y --no-install-recommends phantomjs; fi && \ rm -rf /var/lib/apt/lists/* && \ # install pchecker - wget https://github.com/hackmdio/portchecker/releases/download/v1.0.5/portchecker-linux-amd64.tar.gz && \ - tar xvf portchecker-linux-amd64.tar.gz -C /usr/local/bin && \ - mv /usr/local/bin/portchecker-linux-amd64 /usr/local/bin/pcheck && \ - rm portchecker-linux-amd64.tar.gz && \ + wget https://github.com/hackmdio/portchecker/releases/download/${PORTCHECKER_VERSION}/portchecker-linux-$(dpkg --print-architecture).tar.gz && \ + tar xvf portchecker-linux-$(dpkg --print-architecture).tar.gz -C /usr/local/bin && \ + mv /usr/local/bin/portchecker-linux-$(dpkg --print-architecture) /usr/local/bin/pcheck && \ + rm portchecker-linux-$(dpkg --print-architecture).tar.gz && \ # Add user and groupd groupadd --gid $GID $USER_NAME && \ useradd --uid $UID --gid $USER_NAME --no-log-init --create-home $USER_NAME && \ diff --git a/runtime/Dockerfile b/runtime/Dockerfile index f08178e..a655de5 100644 --- a/runtime/Dockerfile +++ b/runtime/Dockerfile @@ -1,4 +1,5 @@ FROM node:8.16.2-jessie +# WARNING this version can't support arm64 ENV DEBIAN_VERSION_NAME=jessie NODE_ENV=production