From dd2d8672ee51acca481cce9baed3ead737bd8ceb Mon Sep 17 00:00:00 2001 From: Alexander Zschach Date: Mon, 1 Apr 2019 12:47:50 +0200 Subject: [PATCH 1/2] Use Debian Stretch and latest NodeJS LTS 10.15.x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed to use Debian Stretch (9) rather than outdated Debian Jessie (8). Also changed the default NodeJS to be latest LTS version 10.15.x. This fixed an issue with bcrypt "undefined symbols" with NodeJS 8.9. Also added a loop to try different GPG Keyservers in case one is unresponsive. Had problems with SKS – sometimes it worked, sometimes not. Last but not least: after Meteor installtion is done, remove and re-install fiber to workaround a "Missing binaries" error with fibers. --- Dockerfile | 4 ++-- scripts/build-meteor.sh | 3 +++ scripts/install-deps.sh | 15 +++++++++++++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3e7f1c4..4dd04c3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:jessie +FROM debian:stretch MAINTAINER Jeremy Shimko RUN groupadd -r node && useradd -m -g node node @@ -28,7 +28,7 @@ ONBUILD ARG APT_GET_INSTALL ONBUILD ENV APT_GET_INSTALL $APT_GET_INSTALL ONBUILD ARG NODE_VERSION -ONBUILD ENV NODE_VERSION ${NODE_VERSION:-8.9.0} +ONBUILD ENV NODE_VERSION ${NODE_VERSION:-10.15.3} ONBUILD ARG NPM_TOKEN ONBUILD ENV NPM_TOKEN $NPM_TOKEN diff --git a/scripts/build-meteor.sh b/scripts/build-meteor.sh index 79a0f30..2d63abf 100755 --- a/scripts/build-meteor.sh +++ b/scripts/build-meteor.sh @@ -40,3 +40,6 @@ mv $BUILD_SCRIPTS_DIR/entrypoint.sh $APP_BUNDLE_DIR/bundle/entrypoint.sh # change ownership of the app to the node user chown -R node:node $APP_BUNDLE_DIR + +# Workaround with missing fiber binary. Remove and re-install +npm uninstall fibers && npm install fibers diff --git a/scripts/install-deps.sh b/scripts/install-deps.sh index ef10605..1abb218 100755 --- a/scripts/install-deps.sh +++ b/scripts/install-deps.sh @@ -10,7 +10,7 @@ apt-get update # ensure we can get an https apt source if redirected # https://github.com/jshimko/meteor-launchpad/issues/50 -apt-get install -y apt-transport-https ca-certificates +apt-get install -y apt-transport-https ca-certificates gpg if [ -f $APP_SOURCE_DIR/launchpad.conf ]; then source <(grep APT_GET_INSTALL $APP_SOURCE_DIR/launchpad.conf) @@ -33,7 +33,18 @@ wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/downloa export GNUPGHOME="$(mktemp -d)" -gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 +key="B42F6819007F00F88E364FD4036A9C25BF357DD4" + +# Try different key servers in case one is unresponsive +# See: https://github.com/bodastage/bts-ce-database/issues/1 +for server in ha.pool.sks-keyservers.net \ + hkp://p80.pool.sks-keyservers.net:80 \ + keyserver.ubuntu.com \ + hkp://keyserver.ubuntu.com:80 \ + pgp.mit.edu; do + gpg --keyserver "$server" --recv-keys "${key}" && break || echo "Trying new server..." +done + gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc From 8b338d090b9dfb801545e4297b420089eca1e72e Mon Sep 17 00:00:00 2001 From: Alexander Zschach Date: Mon, 1 Apr 2019 14:40:46 +0200 Subject: [PATCH 2/2] Install bcrypt --- scripts/build-meteor.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-meteor.sh b/scripts/build-meteor.sh index 2d63abf..91ff8c9 100755 --- a/scripts/build-meteor.sh +++ b/scripts/build-meteor.sh @@ -23,7 +23,7 @@ cd $APP_SOURCE_DIR # Install app deps printf "\n[-] Running npm install in app directory...\n\n" -meteor npm install +meteor npm install && meteor npm install bcrypt # build the bundle printf "\n[-] Building Meteor application...\n\n"