Yarn: Need official node-yarn docker image

Created on 13 Feb 2017  路  6Comments  路  Source: yarnpkg/yarn

One of the biggest obstacles to my team adopting yarn was putting together a docker image that included yarn. After doing a bunch of work i've determined that this very easy but non-obvious. It doesn't help that search results return a number of individual contributions that are flawed in one way or another. Many use the npm install method which is not recommended and others use curl -o- -L https://yarnpkg.com/install.sh | bash which installs only for the current user.

Here's my take - https://hub.docker.com/r/mattkime/node-yarn/

Let me know if there's anything i can do to help move this forward.

Most helpful comment

FYI, Yarn is now part of the official Node.js Docker image: https://github.com/nodejs/docker-node/issues/243. So you don't have to use the node-yarn image any more.

All 6 comments

It's hard to have an official image due to the number of possible variations. Some people might want to use Debian, others may want to use Ubuntu. Some people may want Node.js 4.x, others may want Node.js 6.x, and others may want Node.js 7.x. Some people may want npm too, other people may just want Yarn and not need npm. Should we have a Dockerfile for every single combination? We could just support one specific combination (say Ubuntu 16.04 + Node.js 7.x + Yarn) but then people will start to ask about other combinations too.

Most likely you are going to need other apps for your environment too, in which case you're better off starting with a bare root environment (such as ubuntu:16.04 or debian:stretch-slim) and installing exactly what you need.

Here's a Dockerfile we use for building Yarn itself, for example: https://github.com/yarnpkg/yarn/blob/master/Dockerfile. It installs Yarn via the Debian repo. This is available at https://hub.docker.com/r/yarnpkg/dev/. I could publish a separate Docker image with just Yarn, if you think that'd be useful.

@Daniel15 Extending the official node images should be sufficient. Simply because we can't satisfy _all_ use cases doesn't mean we can't satisfy _most_ use cases.

Sure, that's doable. I'll add a Docker image soon when I revise the dev one 馃憤

Possible duplicate of https://github.com/yarnpkg/yarn/issues/1577.

We'd also like to use yarn in GitLab CI, but the lack of an official Docker image keeps us in NPM.

Now available as yarnpkg/node-yarn in the Docker Hub: https://hub.docker.com/r/yarnpkg/node-yarn/

C:\src\yarn> docker run -it --rm yarnpkg/node-yarn:latest /bin/bash
root@13ead647da12:/# yarn --version
0.20.3

FYI, Yarn is now part of the official Node.js Docker image: https://github.com/nodejs/docker-node/issues/243. So you don't have to use the node-yarn image any more.

Was this page helpful?
0 / 5 - 0 ratings