install mongoose in docker container install mongoose in docker container docker docker

install mongoose in docker container


This is just an output from node-gyp. You can ignore this messages if you don't use the MongoDB Enterprise with Kerberos Authentication.

Nevertheless the docker build command will run successfully and mongoose will also work.

The output above is just about some pragam directives. The pragma statement was introduced with ANSI-C to define compiler options.

For example have a look at:

../lib/kerberosgss.c: In function 'authenticate_gss_client_wrap':../lib/kerberosgss.c:348:19: warning: variable 'server_conf_flags' set but not used [-Wunused-but-set-variable]char buf[4096], server_conf_flags;

This just tells you, that the variable server_conf_flags defined in lib/kerberosgss.c:348:19 is not used anywhere. If you look at the source on github, this is not a problem.

Each C-compiler handles these pragam directives slightly different which is intentionally. Maybe on your local machine you have got a different C-compiler or a completely different OS?

So this is nothing to worry about.


Just like the other answer mentioned, you don't need to worry about these warning. These comes for unknown pragma definition to gcc. For example:

../lib/kerberosgss.c:27:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] #pragma clang diagnostic push

This warning pops up because of the clang pragma which in unknown to gcc.

If you still want to get rid of the warnings, you can set cflags to ignore these warnings. To do this with node-gyp, edit ~/.node-gyp/<node_version>/include/node/common.gypi:

Find the line:

'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],

and replace it with:

'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', '-Wno-unknown-pragmas','-Wno-unused-but-set-variable', ],

This is where default flags are stored. Note the two extra flags to disable the warnings. In docker, you can use sed to replace the cflags line with the above.

And I'm not sure why you don't get the warnings in your local environment. Most likely because you are using different compiler other than gcc or may be the gcc version you are using, have those flags already set.


Edit: If you don't see the ~/.node-gyp/ directory, run these commands first. This will install development files for the specified node version:

npm install -g node-gypnode-gyp install