Skip to content

Commit

Permalink
Manually override linux_use_gold_flags in toolchain.gypi
Browse files Browse the repository at this point in the history
This appears to be the only option for now to get this to compile on
certain OS/architecture combinations (Docker Hub being one of them).

Hopefully this is just a temporary solution.

See nodejs/node#4212 and
nodejs/node#6603 for more details.
  • Loading branch information
mhart authored and PetarKirov committed Nov 15, 2017
1 parent c285423 commit 5c5ab1f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ENV VERSION=v0.10.45 CFLAGS="-D__USE_MISC" NPM_VERSION=2
ENV CONFIG_FLAGS="--without-npm" RM_DIRS=/usr/include
# ENV CONFIG_FLAGS="--fully-static --without-npm" DEL_PKGS="libgcc libstdc++" RM_DIRS=/usr/include

RUN apk add --no-cache curl make cmake gcc g++ binutils-gold python linux-headers paxctl libgcc libstdc++ gnupg && \
RUN apk add --no-cache curl make cmake gcc g++ python linux-headers paxctl libgcc libstdc++ gnupg && \
gpg --keyserver pool.sks-keyservers.net --recv-keys 9554F04D7259F04124DE6B476D5A82AC7E37093B && \
gpg --keyserver pool.sks-keyservers.net --recv-keys 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 && \
gpg --keyserver pool.sks-keyservers.net --recv-keys 0034A06D9D9B0064CE8ADF6BF1747F4AD2306D93 && \
Expand All @@ -24,7 +24,10 @@ RUN apk add --no-cache curl make cmake gcc g++ binutils-gold python linux-header
gpg --verify SHASUMS256.txt.asc && \
grep node-${VERSION}.tar.gz SHASUMS256.txt.asc | sha256sum -c - && \
tar -zxf node-${VERSION}.tar.gz && \
cd /node-${VERSION} && \
cd node-${VERSION} && \
if [ -f deps/v8/build/toolchain.gypi ]; then \
sed -i -e "s/'linux_use_gold_flags%': 1/'linux_use_gold_flags%': 0/" deps/v8/build/toolchain.gypi; \
fi && \
./configure --prefix=/usr ${CONFIG_FLAGS} && \
NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \
make -j${NPROC} -C out mksnapshot BUILDTYPE=Release && \
Expand All @@ -37,7 +40,7 @@ RUN apk add --no-cache curl make cmake gcc g++ binutils-gold python linux-header
npm install -g npm@${NPM_VERSION} && \
find /usr/lib/node_modules/npm -name test -o -name .bin -type d | xargs rm -rf; \
fi && \
apk del curl make gcc g++ binutils-gold python linux-headers paxctl gnupg ${DEL_PKGS} && \
apk del curl make gcc g++ python linux-headers paxctl gnupg ${DEL_PKGS} && \
rm -rf /etc/ssl /node-${VERSION}.tar.gz /SHASUMS256.txt.asc /node-${VERSION} ${RM_DIRS} \
/usr/share/man /tmp/* /var/cache/apk/* /root/.npm /root/.node-gyp /root/.gnupg \
/usr/lib/node_modules/npm/man /usr/lib/node_modules/npm/doc /usr/lib/node_modules/npm/html

0 comments on commit 5c5ab1f

Please sign in to comment.