-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publish Yarn to the Alpine Linux package repository (APK) #1326
Comments
Hi James! 😄 Looks like fpm added support for Alpine Linux packages. We're already using fpm to build the CentOS/RHEL .rpm, so I should be able to build an Alpine Linux package too. |
Any news here? There will be official Alpine images for node shortly (docker-library/official-images#2334), being able to install a self-contained yarn into that would be sweet |
I'll try to take a look this weekend. It looks like Alpine only has Node.js 6.7.0 at the moment: https://pkgs.alpinelinux.org/package/v3.4/main/x86_64/nodejs. I guess that's fine, I wonder how well-maintained the Node.js packages are though. |
https://github.com/mhart/alpine-node is a popular image that is regularly maintained. These Alpine images already have Node installed, apk add yarn just needs to install Yarn -- if it pulls in an extra copy of Node that defeats the purpose of using a small image like Alpine. |
I'd prefer it if it just installed yarn yes, as it will only be used where Node is already available |
Sure, I can do that. I wonder if Alpine has something like a "recommends" relation between packages. Debian does that - We "recommend" the Node.js package, but people can ignore the recommendation if they have Node.js installed via alternate means (for example, nvm, or compiled from source). |
Currently blocked by jordansissel/fpm#1227 As an aside:
Have you considered using Debian? It's also much lighter than Ubuntu. |
Self explanatory. |
Any news here? |
Currently blocked by the fpm bug linked earlier in the thread.
Sent from my phone.
…On Dec 17, 2016 7:49 PM, "Lukas Oppermann" ***@***.***> wrote:
Any news here?
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#1326 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAFnHTSsEJD0VXXwPKZUsPDjh9dNl7o7ks5rI6IXgaJpZM4Kc3Nl>
.
|
I have an open PR to do this alpinelinux/aports#714 |
yarn package is now available in the alpine edge/testing repo |
Indeed!
|
@errm Thanks! is it possible to update the package to also patch the |
yes I certainly can add that ... |
Cool, thanks. I'm going to close this out since the package exists now. Thank you so much, @errm! |
requested upstream yarnpkg/yarn#1326 (comment)
requested upstream yarnpkg/yarn#1326 (comment)
requested upstream yarnpkg/yarn#1326 (comment)
requested upstream yarnpkg/yarn#1326 (comment)
I get a strange behavior when doing
|
@amir20 You didn't mention what the strange behaviour actually is 😛 |
Okay, this should give a pretty small container with FROM mhart/alpine-node:base
RUN apk add --no-cache curl && \
mkdir -p /opt && \
curl -sL https://yarnpkg.com/latest.tar.gz | tar xz -C /opt && \
mv /opt/dist /opt/yarn && \
ln -s /opt/yarn/bin/yarn /usr/local/bin && \
apk del --purge curl |
@silverwind I'd suggest locking down the version of Yarn being used (like I did in my example above). Also if you're only using |
I like using the latest one in this case so I don't have to maintain the version. And I'm not using |
@silverwind If you use the latest version of Docker (1.13), you can do |
If you want node7 you can just install the |
@errm will that help the situation with |
@errm oh – indeed it does:
Nice! 👍 |
I see, because http://git.alpinelinux.org/cgit/aports/tree/community/nodejs-current/APKBUILD#n17 |
Still struggling with this one.
|
Depends on how you're running your builds. I'd suggest having a Docker image with everything required for your build, and then use that as part of your build system. That way, all dependencies are already preinstalled.
If you're using Docker, you should only need to install your dependencies once, and then all of your builds should use the resulting Docker image. That means that the slowness of installing Yarn should only be an issue once (or rather, once for every time you update the Dockerfile). You'll likely need to publish the Docker image to the Docker Hub to use it. Also your hand baked once isn't performing any integrity checking via GPG - You should at least add that. The GPG key is available at |
@Daniel15 thanks, very helpful and good point on integrity checking. i've reverted back to the official way for now. last 2 things i'm not sure about is handling the seems pretty complex compared to just using good old |
I don't think handling the Yarn cache would be any more difficult than handling the npm cache... I'm not familiar enough with Docker to know the best way to handle Yarn's cache. |
I'm running on mhart/alpine-node:7.1.0
Why I yarn installing and replacing node installed? |
I think doing |
@whitecolor because node in the base image wasn't installed using apk – so the yarn apk package knows nothing about it |
@whitecolor you should install yarn manually if you want to use that docker image – see these comments: #1326 (comment) or #1326 (comment) |
Thanks to @mhart, Yarn is now included in the alpine-node (v8+) Docker image: mhart/alpine-node#65 (comment). This is especially useful since we've found some issues with npm 5 so having an alternative out of the box is great. |
Now images should be updated more often) as Yarn and NPM5 still have a lot of minor bugs |
Isn't there automatic publishing in alipne repo? https://pkgs.alpinelinux.org/packages?name=yarn&branch=&repo=&arch=&maintainer= The latest available version is still 0.24 |
The Alpine repo is community maintained; it's not maintained by the Yarn team. You'd need to contact its maintainer to get the package updated. |
|
Hi I am the maintainer of the alpine package... I have been tracking the stable version of yarn. Feel free to ping me if I miss an update. The latest release of alpine linux (3.7) includes yarn 1.3.2 Note that unless there is a security issue, the version included in 3.7 won't be updated... to get newer versions (when they become stable) you will need to wait for a new release of alpine (roughly every 6 months) or use the edge version (not recommended for a production system). |
For those coming here from search results and are looking to install yarn from Alpine repos, it is indeed included in v3.7. Since it wasn't mentioned here, you need to enable the community repo in NodeJS is already available in the main repo and is v8.9.3, so no worries there. Thank you @errm for maintaining this. |
Having a lot of fun between this and Webpack 4! :P |
This is a feature request to publish Yarn to Alpine Linux's package repository. The primary motivation is to be able to more easily use Yarn when building Docker images built on top of Alpine Linux. (Alpine is a distro that's much lighter than Ubuntu and earlier this year there was some discussion that Docker was moving its official images to Alpine: https://www.brianchristner.io/docker-is-moving-to-alpine-linux/.)
Feb 2017 Edit: Following the discussion below, if you are running Alpine in a Docker image that already includes Node (ex:
mhart/alpine-node:base-7
), you might want to install Yarn by copying the files directly:The text was updated successfully, but these errors were encountered: