Skip to content

Commit

Permalink
most important part
Browse files Browse the repository at this point in the history
  • Loading branch information
nextdude committed Jan 19, 2019
1 parent 65e6a18 commit 6a3affd
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
NODE_MAJOR=11
RUBY_BASE=ruby:2.6
# node release keys pulled from https://github.com/nodejs/node#release-team
KEYS=4ED778F539E3634C779C87C6D7062848A1AB005C 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 77984A986EBC2AA786BC0F66B01FBB92821C587A 8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 A48C2BEE680E841632CD4E44F07496B3EB3C1762 B9AE9905FFD7803F25714661B63B535A4C206CA9 B9E2F5981AA6E0CD28160D9FF13993A75599653C C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 DD8F2338BAE7501E3DD5AC78C273792F7D83545D FD3A5288F042B6850C66B31F09FE44734EB7990E
TAG_VERSION=2.6-11
61 changes: 61 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
ARG RUBY_BASE=ruby:2
FROM $RUBY_BASE
MAINTAINER [email protected]

ENV LANG C.UTF-8

RUN groupadd --gid 1000 node \
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node

ARG KEYS
ENV KEYS ${KEYS}

RUN mkdir ~/.gnupg
RUN chmod 700 ~/.gnupg
RUN echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf

# gpg keys listed at https://github.com/nodejs/node#release-team
RUN set -ex \
&& for key in ${KEYS}; \
do \
echo "$key"; \
gpg --no-tty --keyserver pool.sks-keyservers.net --recv-keys "$key"; \
done

ARG NODE_MAJOR=11
ENV NODE_MAJOR ${NODE_MAJOR}

RUN NODE_VERSION=$(curl -SL "https://nodejs.org/dist/index.tab" \
| grep "^v$NODE_MAJOR" \
| head -n 1 | awk '{ print substr($1,2) }') \
&& 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 \
&& curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
&& curl -SLO --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

RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --import
RUN YARN_VERSION=$(curl -sSL --compressed https://yarnpkg.com/latest-version) \
set -ex \
&& curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
&& curl -fSLO --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 ruby -v && echo -n "node " && node -v && echo -n "yarn " && yarn -v && ls -la /usr/local/bin

0 comments on commit 6a3affd

Please sign in to comment.