Skip to content

Instantly share code, notes, and snippets.

@lmakarov
Created July 12, 2018 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lmakarov/1519be9f5b37534b0feafe5bf4d244bf to your computer and use it in GitHub Desktop.
Save lmakarov/1519be9f5b37534b0feafe5bf4d244bf to your computer and use it in GitHub Desktop.
Node.js + yarn installation via apt in Docker
# Node.js
ENV NODE_VERSION=8.x
RUN set -xe; \
# Node.js repo
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -; \
echo "deb https://deb.nodesource.com/node_${NODE_VERSION} jessie main" | sudo tee /etc/apt/sources.list.d/nodesource.list; \
echo "deb-src https://deb.nodesource.com/node_${NODE_VERSION} jessie main" | sudo tee -a /etc/apt/sources.list.d/nodesource.list; \
# yarn repo
curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -; \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list; \
apt-get update >/dev/null; \
apt-get -y --no-install-recommends install >/dev/null \
nodejs \
yarn \
;\
apt-get clean; rm -rf /var/lib/apt/lists/*;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment