Skip to content

Commit 6c84971

Browse files
Updated documentation for new log level
Completes nodejs#535
1 parent 9d82d3f commit 6c84971

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

README.md

+8-16
Original file line numberDiff line numberDiff line change
@@ -104,28 +104,20 @@ $ docker run -it --rm --name my-running-script -v "$PWD":/usr/src/app -w /usr/sr
104104

105105
## Verbosity
106106

107-
By default the Node.js Docker Image has npm log verbosity set to `info` instead
108-
of the default `warn`. This is because of the way Docker is isolated from the
109-
host operating system and you are not guaranteed to be able to retrieve the
110-
`npm-debug.log` file when npm fails.
111-
112-
When npm fails, it writes it's verbose log to a log file inside the container.
113-
If npm fails during an install when building a Docker Image with the `docker
114-
build` command, this log file will become inaccessible when Docker exits.
115-
116-
The Docker Working Group have chosen to be overly verbose during a build to
117-
provide an easy audit trail when install fails. If you prefer npm to be less
118-
verbose you can easily reset the verbosity of npm using the following
119-
techniques:
107+
Prior to 8.7.0, 6.11.4 and 4.8.4 the docker images overrode the default npm log
108+
level from `warn` to `info`. However due to improvements to npm and new Docker
109+
patterns (e.g. multi-stage builds) the working group reached a [consensus](https://github.com/nodejs/docker-node/issues/528)
110+
to revert the log level to npm defaults. If you need more verbose output, please
111+
use one of the following methods to change the verbosity level.
120112

121113
### Dockerfile
122114

123115
If you create your own `Dockerfile` which inherits from the `node` image you can
124116
simply use `ENV` to override `NPM_CONFIG_LOGLEVEL`.
125117

126-
```
118+
```dockerfile
127119
FROM node
128-
ENV NPM_CONFIG_LOGLEVEL warn
120+
ENV NPM_CONFIG_LOGLEVEL info
129121
...
130122
```
131123

@@ -135,7 +127,7 @@ If you run the node image using `docker run` you can use the `-e` flag to
135127
override `NPM_CONFIG_LOGLEVEL`.
136128

137129
```
138-
$ docker run -e NPM_CONFIG_LOGLEVEL=warn node ...
130+
$ docker run -e NPM_CONFIG_LOGLEVEL=info node ...
139131
```
140132

141133
### NPM run

0 commit comments

Comments
 (0)