Отдельный стандартный вывод и стандартный вывод для `запуска докера `?

Создать отчет для последующей проверки, содержащий информацию о текущем каталоге (и подкаталогах ), сохраненных вreportfile:

ncdu -o reportfile

Открытие ранее созданного отчета:

ncdu -f reportfile

Изman ncdu:

-f FILE

Load the given file, which has earlier been created with the "-o" option. If FILE is equivalent to "-", the file is read from standard input.

[...]

-o FILE

Export all necessary information to FILE instead of opening the browser interface. If FILE is "-", the data is written to standard output. See the examples section below for some handy use cases.

Be warned that the exported data may grow quite large when exporting a directory with many files. 10.000 files will get you an export in the order of 600 to 700 KiB uncompressed, or a little over 100 KiB when compressed with gzip. This scales linearly, so be prepared to handle a few tens of megabytes when dealing with millions of files.

For the sake of preventing a screw-up, the current version of ncdu will assume that the directory information in the imported file does not represent the filesystem on which the file is being imported. That is, the refresh and file deletion options in the browser will be disabled.

1
27.10.2020, 14:03
1 ответ

Проблема для вас заключается в опции ' -t'. После его удаления stderr должен работать как положено:

$ docker run -i --rm alpine sh -c 'echo this is stdout; echo this is stderr >&2' 2>stderr
this is stdout
$ cat stderr
this is stderr

Когда вы используете опцию ' -t' (или --tty ), stdout и stderr объединяются. Это явно не задокументировано в докере, потому что «это нормальное поведение tty». [Источник:moby issue 25542, комментарий 238647584 от bamarni ]

3
18.03.2021, 22:54

Теги

Похожие вопросы