Skip to content
This repository has been archived by the owner on Jun 5, 2021. It is now read-only.

Introduce a dockerized NodeJS example #14

Merged
merged 7 commits into from Aug 23, 2018
Merged

Introduce a dockerized NodeJS example #14

merged 7 commits into from Aug 23, 2018

Conversation

fwouts
Copy link
Owner

@fwouts fwouts commented Aug 21, 2018

This should help address part of #13.

@enriched could you give an example of native node module that would break with this?

@enriched
Copy link
Contributor

@fwouts durable_rules is one that I have had break on me in the past. I also had a coworker complain about node-sass not working, which is probably more popular.

@fwouts
Copy link
Owner Author

fwouts commented Aug 22, 2018

Thanks, I got it failing successfully now. This might take a while to fix :)

@fwouts
Copy link
Owner Author

fwouts commented Aug 22, 2018

Hi @enriched, could you check the workaround df98825 above? I'm not sure if the Docker rules allow running these commands at build time. This seems suboptimal. What do you think of this approach? Any better ideas?

@enriched
Copy link
Contributor

@fwouts It's possible that Bazel just doesn't have the concepts to address the native modules yet. I think that (in my limited understanding) the issues Skylark supports multi-architecture ("fat") binaries and Skylark supports platform transitions might add the concepts to Bazel that can deal with this?

I think that I could use something like dazel so that the yarn install was run inside a docker container. But I think that file IO with mounted volumes is fairly slow.

In the meantime, I think that your workaround looks like it would be the best solution. Probably a hit to startup time. Or I might be able to find a way to run that command with kaniko as a final build step.

@fwouts
Copy link
Owner Author

fwouts commented Aug 23, 2018

Thanks, lots of good ideas.

FYI I also toyed with the idea of setting the target platform with --platform but didn't get any positive results, because it looks like the Bazel rules themselves must implement some custom logic for this (yarn still ended up installing into node_modules/node-sass/vendor/darwin-x64-57 when using a Linux x64 target platform).

There's also https://github.com/bazelbuild/bazel-toolchains that looks interesting (but requires being run in a remote environment).

In the meantime, I'll get this merged in (the CircleCI error is unrelated (bazelbuild/bazel#5964).

@fwouts fwouts merged commit 93967e1 into master Aug 23, 2018
@fwouts fwouts deleted the dockerized-node branch August 23, 2018 20:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants