What is the command of the running node server in docker using DEBUG? I tried following commands in dockerfile but no luck.
CMD [ "npm", "DEBUG=* start" ]
CMD [ "DEBUG=*", "npm", "start" ]
Could you please help me?
That form doesn't work. You should look up the array vs. string forms of the CMD command. You're trying to use a shell feature in an argv array.
This is something I can't explain to you in a brief response - if you truly want to understand it, look up how the exec() function works (Google man exec). That will help you understand what's happening here.
The proper way to fix this according to the 12factor guidelines is to pass -e DEBUG='*' to your docker run command line.
The only way to do this from within the Dockerfile is to use the non-array form of CMD or use a shell script that exports DEBUG and then uses exec to replace the process with your node application.
This is much better suited for StackOverflow by the way - not an issues tracker for a library you're using.
Most helpful comment
That form doesn't work. You should look up the array vs. string forms of the
CMDcommand. You're trying to use a shell feature in an argv array.This is something I can't explain to you in a brief response - if you truly want to understand it, look up how the
exec()function works (Googleman exec). That will help you understand what's happening here.The proper way to fix this according to the 12factor guidelines is to pass
-e DEBUG='*'to yourdocker runcommand line.The only way to do this from within the Dockerfile is to use the non-array form of
CMDor use a shell script that exportsDEBUGand then usesexecto replace the process with your node application.This is much better suited for StackOverflow by the way - not an issues tracker for a library you're using.