LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Containers
User Name
Password
Linux - Containers This forum is for the discussion of all topics relating to Linux containers. Docker, LXC, LXD, runC, containerd, CoreOS, Kubernetes, Mesos, rkt, and all other Linux container platforms are welcome.

Notices


Reply
  Search this Thread
Old 07-01-2019, 05:39 AM   #1
Mark_667
Member
 
Registered: Aug 2005
Location: Manchester, England
Distribution: Ubuntu 20.04
Posts: 383

Rep: Reputation: 30
Getting NodeJS logs from a Docker container


I'm trying to Dockerise a NodeJS microservice but it seems to be silently bombing out when run. It's probably an incorrect path to the app.js but I can't get any error output to see what's happening. I'm trying to run it using:
Code:
CMD [ "node", "app.js" ]
Code:
CMD [ "DEBUG=express:* node", "app.js" ]
Gives
Error: Cannot find module '/home/node/app/DEBUG=express:* node'
I can get a debugger listening using --inspect but can't connect to it and that's for debugging running code anyway.
I've not been able to find anything that works in a Docker container, how do others do this?
 
Old 07-01-2019, 07:01 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
To pass environment variables to a containerized program, use an environment file or the -e option when launching it under Docker. This stackoverflow thread seems to be rather useful.
 
1 members found this post helpful.
  


Reply

Tags
docker, node.js



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Docker Guide: Dockerizing Nodejs Express Application on Ubuntu 18.04 LXer Syndicated Linux News 0 09-19-2018 11:16 PM
LXer: Inside the Open Container Project: How Docker plans to unite the container market LXer Syndicated Linux News 0 06-23-2015 04:30 AM
Back up logs file and create a script showing the backed up logs and the running logs Billy_6052 Programming 5 12-13-2014 02:32 AM
[SOLVED] nodejs, nodejs-dev incompatibility in Ubintu? mjbradakis Linux - Software 1 03-24-2013 11:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Containers

All times are GMT -5. The time now is 07:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration