Skip to content
This repository has been archived by the owner on Jan 15, 2023. It is now read-only.

Latest image has not yarn installed despite README saying so #90

Closed
vampolo opened this issue Jun 2, 2017 · 9 comments
Closed

Latest image has not yarn installed despite README saying so #90

vampolo opened this issue Jun 2, 2017 · 9 comments

Comments

@vampolo
Copy link

vampolo commented Jun 2, 2017

Latest changes that brought node v8 and yarn do not fully install yarn as the installation is prevented by an if statement at line 30 of the dockerfile

  if [ -z "$CONFIG_FLAGS" ]; then \

Proof

image

@mhart
Copy link
Owner

mhart commented Jun 2, 2017

Works fine for me:

$ docker run mhart/alpine-node:latest yarn --version
0.24.6

@mhart
Copy link
Owner

mhart commented Jun 2, 2017

Are you sure you're not looking at the Dockerfile from a base image (which has a static build of nodejs with no npm or yarn)?

@nazimjamil
Copy link

What does your dockerfile look like @mhart? I'm not able to use Yarn when building with FROM mhart/alpine-node:base-6.

@mhart
Copy link
Owner

mhart commented Jun 5, 2017

@nazimjamil the base images are builds of Node.js as a static binary – no npm or yarn in those builds. Use those builds for when you have no dependencies – or you just have JS dependencies that are already installed when you run docker build

@mhart
Copy link
Owner

mhart commented Jun 5, 2017

@vampolo going to mark this as closed, as the latest image clearly has yarn – let me know if you can reproduce your issue

@mhart mhart closed this as completed Jun 5, 2017
@vampolo
Copy link
Author

vampolo commented Jun 5, 2017

@mhart yeah it is all good. Yarn is installed for root user only. as soon as i switched to another user in my dockerfile i wasn't able to use yarn anymore.
Seems not a problem strictly related to alpine-node, but it was the way i was using it.
Besides, if yarn was installed globally like npm, any user on alpine-node would not have this problem.

@mhart
Copy link
Owner

mhart commented Jun 5, 2017

Hmmm, this is a good point – the install script for yarn uses the home directory, but I'm thinking it might be better to add it in a more global directory.

I'll play around with some things and update here

@mhart
Copy link
Owner

mhart commented Jun 5, 2017

Ok, I've decided to install it in /usr/local/share/yarn – and symlink in /usr/local/bin

Have updated the latest, 8, 8.0, and 8.0.0 images with these changes

@vampolo
Copy link
Author

vampolo commented Jun 5, 2017

Brilliant! thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants