Skip to content
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

Officially support Alpine linux #1589

Closed
xzyfer opened this issue Jun 12, 2016 · 78 comments
Closed

Officially support Alpine linux #1589

xzyfer opened this issue Jun 12, 2016 · 78 comments

Comments

@xzyfer
Copy link
Contributor

xzyfer commented Jun 12, 2016

What

We do not currently support Alpine Linux. It is commonly used to as a minimal base image with docker. Given the rising popularity of docker (and containerisation in general) I believe supporting Alpine Linux with a pre-built binaries is the right thing to do for the community.

Why

There is not explicit reason for us not supporting Alpine Linux, nor did make a conscious decision not to. We prebuild a "Linux" binaries which is targeted at popular distributions, namely those derived from Debian with a special consideration for CentOS 5. However that Linux is not compatible with the versions of libc(?) that ship with Alpine.

How

To achieve this we need to two things from the community.

Firstly we need a Dockerfile that when run for a given node-sass commit-ish, compiles the node-sass binary for all 32bit and 64bit version of Node 0.10, 0.12. iojs 1, iojs 2, iojs 3, Node 4, Node 5, Node 6. For reference here is the one we use for the Linux binaries

Secondly a JavaScript function that reliable detects the current OS is Alpine Linux.

@amrocha
Copy link

amrocha commented Jun 12, 2016

Hey, I'm looking into getting this done. I'm working off a version of the Dockerfile you linked. Still not sure how to detect Alpine as the current OS but I haven't thought too much about it yet.

@xzyfer
Copy link
Contributor Author

xzyfer commented Jun 14, 2016

@amrocha currently we detect the underlying OS using process.platform. This however return linux Alpine. What we need is a way to differentiate Alpine from other linux distributions. This way we can download an alpine specific binary when installing rather than the generic linux binary.

There's some background information #756 where something similar was previously discussed to distinguish between different FreeBSD binaries.

@saper
Copy link
Member

saper commented Jun 17, 2016

Can somebody drop the contents of the process node variable when running node on alpine? I don't think nodejs.org provides the Alpine-based build: what kind of build are people using to run node on that platform?

@xzyfer
Copy link
Contributor Author

xzyfer commented Jun 18, 2016

@saper I've asked for help from the Twitterspehere

@amrocha
Copy link

amrocha commented Jun 18, 2016

So here's where I am:

  • NVM doesn't support Alpine because it downloads pre-compiled node binaries, and Node doesn't provide Alpine binaries either;
  • Alpine's package manager doesn't have IO.js or older versions of Node available as a package, and doesn't let you choose if you want the 32 bit or 64 bit version of a package so that doesn't work either;

What I'm doing right now is downloading the Node source and building it for every single version node-sass supports, but I'm having internet speed issues at home right now so I can only really get any progress done on this when I'm at work.

@xzyfer
Copy link
Contributor Author

xzyfer commented Jun 18, 2016

Thanks for looking at this. If you make the dockerfile a gist that'd be
great. If alpine doesn't official support iojs then we possibly don't need
to bother with those binaries.
On 19 Jun 2016 2:47 AM, "Andre" notifications@github.com wrote:

So here's where I am:

  • NVM doesn't support Alpine because it downloads pre-compiled node
    binaries, and Node doesn't provide Alpine binaries either;
  • Alpine's package manager doesn't have IO.js or older versions of
    Node available as a package, and doesn't let you choose if you want the 32
    bit or 64 bit version of a package so that doesn't work either;

What I'm doing right now is downloading the Node source and building it
for every single version node-sass supports, but I'm having internet speed
issues at home right now so I can only really get any progress done on this
when I'm at work.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#1589 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAjZWOH9N-npSNazTnn9sUyAlJCiNaKBks5qNCE3gaJpZM4IzxUh
.

@amrocha
Copy link

amrocha commented Jun 20, 2016

Here's the dockerfile I'm using:
https://gist.github.com/amrocha/56ffd0246a8bf31b72ae4667fbd1ea99

Alpine's package manager, apm, provides the following node versions:

  • 0.10
  • 0.12
  • 4.x
  • 5.x
  • 6.x

I'll try asking the maintainer for the node package if there's a way of specifying if you want the 32 or 64 bit version, but it doesn't seem like there is.

@xzyfer
Copy link
Contributor Author

xzyfer commented Jun 21, 2016

@amrocha thank you for your work on this. If 32bit version are difficult to by I wouldn't bother until someone requests it.

@xzyfer
Copy link
Contributor Author

xzyfer commented Jun 21, 2016

I would simply stick to the versions of Node made available via apm.

@amrocha
Copy link

amrocha commented Jun 21, 2016

@xzyfer that should be a lot easier, I'll see if I can get something together by the end of the day today

@amrocha
Copy link

amrocha commented Jun 21, 2016

So I dug in a little bit more and turns out I was wrong about the versions of node Alpine provides. The versions above are all the versions that it has provided at some point in time, but you can only download the latest version.

Sorry about the confusion, I didn't expected that older versions would be unavailable.

@saper
Copy link
Member

saper commented Jun 21, 2016

@amrocha maybe there is a way to retrieve old package building information and re-build the node binaries yourself? For FreeBSD I have recovered old definitions and I keep using them to have older io.js binaries available.

@amrocha
Copy link

amrocha commented Jun 22, 2016

@saper I could look into doing something similar, is there any difference between doing that and just building node from source though?

@xzyfer
Copy link
Contributor Author

xzyfer commented Jun 22, 2016

Building from source is fine :)
On 22 Jun 2016 10:47 AM, "Andre" notifications@github.com wrote:

@saper https://github.com/saper I could look into doing something
similar, is there any difference between doing that and just building node
from source though?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1589 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAjZWKl3rzV1YowXitOQf2P8qc3MkOpEks5qOIYQgaJpZM4IzxUh
.

@spralle
Copy link

spralle commented Jul 4, 2016

Any progress on this? I think it would help a lot of people!

@amrocha
Copy link

amrocha commented Jul 4, 2016

Sorry I haven't had much time to work on this. I want to build all the node versions first, and then compile the node-sass binaries for each of them, that way the node versions will be cached and you won't have to build them every time a new version is released. The Dockerfile I linked above works, but since there's no node version managers that work in Alpine I don't have an easy way to switch between versions. I was going to write my own simplistic implementation but just haven't had time to do it.

@spralle
Copy link

spralle commented Jul 4, 2016

I'm not sure if I understand what you want to do, but can't you just use the same way like this image is doing to get different node versions?

https://github.com/mhart/alpine-node/blob/master/Dockerfile

@amrocha
Copy link

amrocha commented Jul 4, 2016

That is pretty much what I'm doing, but I need to have multiple versions of node installed at the same time so I also need a way of managing versions.

@jgallen23
Copy link

It might be easier to not try to build multiple versions of node at the same time. Just create a Dockerfile that has the node-sass stuff in it and then starts with FROM mhart/alpine-node:X.X.X. Then just change the version, build, and repeat for all the version numbers you want to support. I think on recent versions of docker, you can pass in environment variables to the build command so it could be as simple as something like NODE_VERSION=4.4.7 docker built -t node-sass:4.4.7 .

@spralle
Copy link

spralle commented Jul 4, 2016

I agree, I think that would be the easier way forward...

@amrocha
Copy link

amrocha commented Jul 11, 2016

Got some time to work on this again and wrote up a script that does what @jgallen23 suggested:

https://gist.github.com/amrocha/d7328f2d637745597fb5f46aad32f327

@xzyfer does this work for you?

@superlbr
Copy link

seems little problem in merge?

@superlbr
Copy link

going to bump a new version?@xzyfer

@xzyfer
Copy link
Contributor Author

xzyfer commented Dec 19, 2016

This should be fixed in v4.1.0. Please test it out and let us know. A big thank you to @lox and @S-YOU.

@xzyfer xzyfer closed this as completed Dec 19, 2016
ddeboer added a commit to driebit/docker-node-gulp that referenced this issue Jan 4, 2017
Thanks to sass/node-sass#1589 an
Alpine-compatible node-sass binary is available from 4.1.0 onwards.
ddeboer added a commit to driebit/docker-node-gulp that referenced this issue Jan 16, 2017
Thanks to sass/node-sass#1589 an
Alpine-compatible node-sass binary is available from 4.1.0 onwards.

Bower requires Git.
ddeboer added a commit to driebit/docker-node-gulp that referenced this issue Feb 9, 2017
Thanks to sass/node-sass#1589 an
Alpine-compatible node-sass binary is available from 4.1.0 onwards.

Bower requires Git.
tinyfly added a commit to tinyfly/elixir that referenced this issue Oct 12, 2017
…linux

gulp-sass v2.1.0 uses node-sass v4.2.0 prior to v4.1.0 node-sass
[wouldn't install correctly on Alpine
Linux](sass/node-sass#1589)
@FernandoMiguel
Copy link

coming at this now.
is there anything i need on my alpine docker for this to work?
any env var?

@xzyfer
Copy link
Contributor Author

xzyfer commented Jun 27, 2018 via email

@ralyodio
Copy link

ralyodio commented Jan 2, 2020

Check the node-sass release notes for the Alpine compatibility table

How do I do that? Got a link?

@saper
Copy link
Member

saper commented Jan 2, 2020

How do I do that? Got a link?

For example for this release

https://github.com/sass/node-sass/releases/tag/v4.13.0

there is a table that says

Supported Environments

OS Architecture Node
Windows x86 & x64 0.10, 0.12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13
OSX x64 0.10, 0.12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13
Linux* x86 & x64 0.10, 0.12, 1, 2, 3, 4, 5, 6, 7, 8**, 9**, 10**^, 11**^, 12**^, 13**^
Alpine Linux x64 6, 8, 10, 11, 12, 13
FreeBSD i386 amd64 6, 8, 10, 12, 13

@ralyodio
Copy link

ralyodio commented Jan 2, 2020 via email

@saper
Copy link
Member

saper commented Jan 2, 2020

When I use node:10-alpine it says there are no node-sass bindings for my platform.

please provide all the information in #2812

jiongle1 pushed a commit to scantist-ossops-m2/node-sass that referenced this issue Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests