Dynamic Languages (Node.JS, Python, PHP, C/C++, Webserver Agent)

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a recommended base Docker image for a NodeJS app?

Highlighted
Producer

Is there a recommended base Docker image for a NodeJS app?

Is there an official recommendation for a base Docker image running NodeJs?  We are trying to instrument a NodeJS application using an Alpine-based Docker image (node:carbon-alpine) and ran into problems launching the proxy.  I've been trying to set it up as proxyless (libagent:true) but now I'm running into logging errors.  I started thinking that perhaps we should switch to a different base image.  Below is the logging error in case anyone has seen this before...

 

/development/docker/app/node_modules/appdynamics/lib/libagent/libagent-connector.js:352
self.libagent.logError(message);
^

TypeError: Cannot read property 'logError' of undefined
at LibagentConnector.logError (/development/docker/app/node_modules/appdynamics/lib/libagent/libagent-connector.js:352:17)
at Logger.error (/development/docker/app/node_modules/appdynamics/lib/core/logger.js:156:28)
at Agent.init (/development/docker/app/node_modules/appdynamics/lib/core/agent.js:320:17)
at AppDynamics.self.(anonymous function) [as profile] (/development/docker/app/node_modules/appdynamics/lib/core/agent.js:575:26)
at Object.<anonymous> (/development/docker/app/server.js:9:8)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! apigateway@1.3.0 start: `node server.js`
npm ERR! Exit status 1

Is there a recommended base Docker image for a NodeJS app?
2 REPLIES 2

Re: Is there a recommended base Docker image for a NodeJS app?

Hi Steven,

 

I guess you are trying to install the nodejs agent through npm? In case of alpine, you have to download the agent binaries from our download zone -

https://download.appdynamics.com/download/#version=&apm=nodejs&os=&platform_admin_os=&events=&eum=&p...

 

Let me know if this helps.

 

Also as an alternative you can also try node-slim​ docker image if you wish to use npm for agent installation.

 

Thanks

Abhimanyu



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.
Producer

Re: Is there a recommended base Docker image for a NodeJS app?

Hi Abhimanyu,

 

  You are correct - I am trying to install 4.5.4 using npm. I tried switching to carbon-slim and got the same error.  I removed libagent config and tried again and got a new error: 

 

Appdynamics agent cannot be initialized due to Error: /development/docker/app/node_modules/appdynamics-protobuf/protobuf_for_node.node: invalid ELF header
Error: /development/docker/app/node_modules/appdynamics-protobuf/protobuf_for_node.node: invalid ELF header
at Object.Module._extensions..node (module.js:682:18)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at requireProtobufBinding (/development/docker/app/node_modules/appdynamics-protobuf/index.js:29:11)
at Object.<anonymous> (/development/docker/app/node_modules/appdynamics-protobuf/index.js:33:18)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)

 

I will try the download and give it a shot...