speed up build

This commit is contained in:
Philipp Kunz 2018-05-04 13:06:23 +02:00
parent a6a71d3de2
commit bb99e6e0b1
2 changed files with 19 additions and 32 deletions

View File

@ -1,8 +1,6 @@
image: hosttoday/ht-docker-dbase image: hosttoday/ht-docker-dbase
services: services:
- docker:dind - docker:dind
variables:
DOCKER_DRIVER: overlay
stages: stages:
- build - build

View File

@ -1,38 +1,27 @@
FROM docker:git FROM docker:git
ENV VERSION=v8.1.3 NPM_VERSION=latest ENV VERSION=v8.11.1 NPM_VERSION=latest
ENV CONFIG_FLAGS="--fully-static" DEL_PKGS="libgcc libstdc++" RM_DIRS=/usr/include ENV CONFIG_FLAGS="--fully-static" DEL_PKGS="libgcc libstdc++" RM_DIRS=/usr/include
RUN apk add --no-cache openssl ca-certificates bash curl make gcc g++ python linux-headers paxctl libgcc libstdc++ gnupg && \ RUN apk add --no-cache \
update-ca-certificates && \ openssl \
gpg --keyserver pool.sks-keyservers.net --recv-keys 9554F04D7259F04124DE6B476D5A82AC7E37093B && \ ca-certificates \
gpg --keyserver pool.sks-keyservers.net --recv-keys 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 && \ bash \
gpg --keyserver pool.sks-keyservers.net --recv-keys 0034A06D9D9B0064CE8ADF6BF1747F4AD2306D93 && \ curl \
gpg --keyserver pool.sks-keyservers.net --recv-keys FD3A5288F042B6850C66B31F09FE44734EB7990E && \ make \
gpg --keyserver pool.sks-keyservers.net --recv-keys 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 && \ gcc \
gpg --keyserver pool.sks-keyservers.net --recv-keys DD8F2338BAE7501E3DD5AC78C273792F7D83545D && \ g++ \
gpg --keyserver pool.sks-keyservers.net --recv-keys C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 && \ python \
gpg --keyserver pool.sks-keyservers.net --recv-keys B9AE9905FFD7803F25714661B63B535A4C206CA9 && \ linux-headers \
curl -o node-${VERSION}.tar.gz -sSL https://nodejs.org/dist/${VERSION}/node-${VERSION}.tar.gz && \ paxctl \
curl -o SHASUMS256.txt.asc -sSL https://nodejs.org/dist/${VERSION}/SHASUMS256.txt.asc && \ libgcc \
gpg --verify SHASUMS256.txt.asc && \ libstdc++ \
grep node-${VERSION}.tar.gz SHASUMS256.txt.asc | sha256sum -c - && \ gnupg \
tar -zxf node-${VERSION}.tar.gz && \ nodejs \
cd node-${VERSION} && \ yarn \
export GYP_DEFINES="linux_use_gold_flags=0" && \ && update-ca-certificates
./configure --prefix=/usr ${CONFIG_FLAGS} && \
NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \
make -j${NPROC} -C out mksnapshot BUILDTYPE=Release && \
paxctl -cm out/Release/mksnapshot && \
make -j${NPROC} && \
make install && \
paxctl -cm /usr/bin/node && \
cd / && \
if [ -x /usr/bin/npm ]; then \
npm install -g npm@${NPM_VERSION} && \
find /usr/lib/node_modules/npm -name test -o -name .bin -type d | xargs rm -rf; \
fi
RUN curl -o- -L https://yarnpkg.com/install.sh | sh RUN curl -o- -L https://yarnpkg.com/install.sh | sh
RUN yarn global add @shipzone/npmci
RUN npm config set unsafe-perm true RUN npm config set unsafe-perm true
ENV PATH /root/.yarn/bin:$PATH ENV PATH /root/.yarn/bin:$PATH