The official docker image for node is: https://hub.docker.com/_/node. This comes with yarn pre-installed at v1.x. I want to upgrade yarn to v2. However, I can't tell how yarn was installed on this image. It's presumably not via npm because if I do npm list, yarn does not show up in the list. I don't know of another way to install yarn. I thought maybe it was via the package manager for linuxkit, which I believe is the distribution used by the node docker image. However I looked at the package-manager for linuxkit – as I understand it they just use git clone and there are a list of packages available in /pkg in the github repository. However, yarn isn't one of those.
Some steps towards an answer, maybe:
yarn on a LinuxKit docker image?node:latest – is there a Dockerfile for that which tells us how the image was generated? If so that might tell me how yarn was installed.]The Best Practices Guide recommends for (simple) local installs
FROM node:6
ENV YARN_VERSION 1.16.0
RUN yarn policies set-version $YARN_VERSION
in your Dockerfile. This guide is worth to be read anyway ;-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With