-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
supporting installing node into an alpine based container #109
Comments
Hi @fagai, As you you might have noticed alpine is a very bare-bones container and is often used for hosting small containers. php:7.3-fpm.alpine does indeed not contain nodejs as seen in this Dockerfile. So you will have to find another image that suits your needs or create your own like this Dockerfile and push it to Docker Hub or any other repository you might have access to. Edit: My bad, this is incorrect. |
@Swiftwork |
You are right @fagai, I'm not sure what I was thinking 😅 |
Node doesn't have a dist yet for alpine where you can pull JIT But they do publish alpine containers with node Can you elaborate on your scenario a bit? Are you trying to test your lib on alpine with node? Are you trying to test a node app meant to distribute with node? |
@bryanmacfarlane |
Have you considered something like this instead? jobs:
build:
runs-on: ubuntu-latest
container:
image: 'node:12.16.1-alpine3.9'
steps:
- uses: actions/checkout@v1
- name: npm install
run: npm install Note that you end up with node 12 in an alpine container and the toolset is sealed (good practice in containers). If you need to customize the container then you can docker build from that image. |
I wanted to use php at the same time, so I made it based on php-fpm image. |
There are unofficial builds for 64-bit alpine provided by a nodejs member: https://unofficial-builds.nodejs.org . They have no dedicated maintainer but the build process is open for contributions if an issue should arise in the future. |
Hello @fagai. Actually setup-node sets up a volume to the toolcache directory where nodejs versions persist. I think node installed to docker image was not compatible with used alpine image. As @adabru mentioned for alpine images unofficial-builds.nodejs.org builds are used or nodejs is built from source code. For now I think the error is expected because setup-node installs nodejs binaries from https://nodejs.org/dist. |
Hello @fagai. I've tried to investigate the issue deeper and it looks like the action won't be able to configure I think the most suitable solution for this will be installing unofficial builds. We have issue with adding mirrors. But you still can have problems with node because alpine does not contain all necessary libs, that is why possibly you'll need to execute apk add --no-cache libstdc++. For now I'm closing the issue. If you have any concerns or questions feel free to ping us. |
Bumps [husky](https://github.com/typicode/husky) from 4.3.0 to 4.3.6. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](typicode/husky@v4.3.0...v4.3.6) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
I use alpine linux for my container.
actions/setup-node succeeds, but npm install fails.
Is there a way to work with alpine linux?
The text was updated successfully, but these errors were encountered: