Skip to content

Instantly share code, notes, and snippets.

@jonlabelle
Last active August 10, 2021 23:48
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 jonlabelle/fafd49c64ce299ba7bd7227de0df995a to your computer and use it in GitHub Desktop.
Save jonlabelle/fafd49c64ce299ba7bd7227de0df995a to your computer and use it in GitHub Desktop.
Docker image for running Yarn v2+ on the latest version on Node.js.
FROM node:latest
# ----------------------------------------------------------------------------
# Gist: https://gist.github.com/jonlabelle/fafd49c64ce299ba7bd7227de0df995a
# ----------------------------------------------------------------------------
# Update NPM and Yarn to the latest versions
RUN npm install --global npm
WORKDIR /app
# Uncomment to disable Yarn telemetry
# RUN yarn config set --home enableTelemetry 0
# Init a new yarn 2x project with Prettier installed
# see: https://yarnpkg.com/getting-started/migration#step-by-step
# and: https://yarnpkg.com/getting-started/recipes#typescript--pnp-quick-start
RUN yarn init --yes --private -2 && \
yarn set version berry && \
yarn add --dev prettier@latest && \
yarn prettier --version
CMD ["/bin/bash", "--login", "-i"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment