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

Fails to install on ubuntu (via docker/node) #53

Open
luisrayas3 opened this issue Feb 28, 2022 · 4 comments
Open

Fails to install on ubuntu (via docker/node) #53

luisrayas3 opened this issue Feb 28, 2022 · 4 comments

Comments

@luisrayas3
Copy link

luisrayas3 commented Feb 28, 2022

I tried installing on my local ubuntu machine and when that didn't work (thought it was my version of node/npm) I tried installing in a docker container:

$ docker pull node:16
$ cat c4builder.Dockerfile
FROM node:16
RUN npm i -g c4builder
$ docker build -t c4builder - < c4builder.Dockerfile

This fails:

npm WARN deprecated [email protected]: This module has moved and is now available at @hapi/hoek. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated [email protected]: This module has moved and is now available at @hapi/topo. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated [email protected]: This module has moved and is now available at @hapi/joi. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm ERR! code 1
npm ERR! path /usr/local/lib/node_modules/c4builder/node_modules/node-plantuml
npm ERR! command failed
npm ERR! command sh -c node scripts/get-vizjs.js
npm ERR! node:events:498
npm ERR!       throw er; // Unhandled 'error' event
npm ERR!       ^
npm ERR! 
npm ERR! Error: spawn java ENOENT
npm ERR!     at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
npm ERR!     at onErrorNT (node:internal/child_process:478:16)
npm ERR!     at processTicksAndRejections (node:internal/process/task_queues:83:21)
npm ERR! Emitted 'error' event on ChildProcess instance at:
npm ERR!     at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
npm ERR!     at onErrorNT (node:internal/child_process:478:16)
npm ERR!     at processTicksAndRejections (node:internal/process/task_queues:83:21) {
npm ERR!   errno: -2,
npm ERR!   code: 'ENOENT',
npm ERR!   syscall: 'spawn java',
npm ERR!   path: 'java',
npm ERR!   spawnargs: [
npm ERR!     '-Dplantuml.include.path=/usr/local/lib/node_modules/c4builder/node_modules/node-plantuml',
npm ERR!     '-Djava.awt.headless=true',
npm ERR!     '-jar',
npm ERR!     '/usr/local/lib/node_modules/c4builder/node_modules/node-plantuml/vendor/plantuml.jar',
npm ERR!     '-testdot'
npm ERR!   ]
npm ERR! }

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-02-28T22_11_43_780Z-debug-0.log
The command '/bin/sh -c npm i -g c4builder' returned a non-zero code: 1

I get the same error using node:alpine or node:17 as the FROM

@raikbitters
Copy link

raikbitters commented Apr 10, 2022

node:16 image doesn't have Java environment. Instead, you can use timbru31/java-node:latest image as a solution.

@craigwardman
Copy link
Contributor

I recently wrote a Dockerfile that can be used to containerize the c4builder tool using a Linux base image.

This has now been merged into the main branch of the c4-builder repo, see: https://github.com/adrianvlupu/C4-Builder/blob/master/Dockerfile

@raikbitters
Copy link

@craigwardman could you publish official image on docker hub?

@craigwardman
Copy link
Contributor

it's not an official image, but I have built the Dockerfile (using 0.2.16 version of c4builder) and pushed it to docker hub under my account, so if you want to run it directly you can use:

docker run -v $(pwd):/pwd craigwardman/c4builder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants