How can you use the multiplatform plugin with a js...
# javascript
h
How can you use the multiplatform plugin with a js target on alpine linux (docker dind)? I always get:
Cannot run program "/root/.gradle/nodejs/node-v14.15.4-linux-x64/bin/node"
Dockerfile
Copy code
FROM docker:dind
RUN apk update
RUN apk add openjdk11-jre-headless
RUN apk add --update nodejs
RUN apk add yarn
RUN apk add chromium
build.gradle.kts
Copy code
plugins.withType<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin> {
    (project.extensions["kotlinNodeJs"] as org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension).apply {
        download = false
    }
}

plugins.withType<org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin> {
    rootProject.the<org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension>().apply {

    }
}
I found this issue in the node-gradle plugin, but does MPP js use this plugin? And iff, how can you include this workaround? https://github.com/node-gradle/gradle-node-plugin/issues/51#issuecomment-623097695
b
You could always use multistage docker builds and build your binary on ubuntu or openjdk (not -alpine) image
h
@Big Chungus Thanks, that's right... 🤦‍♂️ This would be easier
c
I had the same issue: the gradle plugin can't install Node on Alpine automatically. Solution 1: build your Docker on top of Alpine: https://gitlab.com/wildfyre/lib/-/blob/master/docker/js.dockerfile Solution 2: just ditch Alpine https://gitlab.com/arcachon-ville/formulaide/-/blob/main/client/build.dockerfile I'll need to check multistage builds, they are probably a better solution.