Skip to content

Instantly share code, notes, and snippets.

@gmacdougall
Created July 4, 2017 19:59
Show Gist options
  • Select an option

  • Save gmacdougall/8a9d0e50f3f86bf555e6f29df2397753 to your computer and use it in GitHub Desktop.

Select an option

Save gmacdougall/8a9d0e50f3f86bf555e6f29df2397753 to your computer and use it in GitHub Desktop.
FROM ruby:2.2.7
ENV N_VERSION 2.1.7
ENV NODE_VERSION 8.1.2
ENV PHANTOMJS_VERSION 2.1.1
ENV YARN_VERSION 0.24.6
# Gems with native extensions
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential fontconfig curl
# NodeJS
RUN curl -L --output /tmp/n.tar.gz https://github.com/tj/n/archive/v$N_VERSION.tar.gz && \
cd /tmp && \
tar xf n.tar.gz && \
cd n-$N_VERSION && \
make && \
n $NODE_VERSION
# PhantomJS
RUN curl --output /usr/local/bin/phantomjs https://s3.amazonaws.com/circle-downloads/phantomjs-$PHANTOMJS_VERSION && \
chmod +x /usr/local/bin/phantomjs
# Yarn
RUN set -ex \
&& for key in \
6A010C5166006599AA17F08146C2130DFD2497F5 \
; do \
gpg --keyserver pgp.mit.edu --recv-keys "$key" || \
gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; \
done \
&& 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/yarn \
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment