devcontainers / devcontainers/cli

devcontainer up trims docker command in logs

未关闭
#704 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
feature-request
主要语言
TypeScript
星标
3k
派生
457
平均合并
13 小时 17 分钟
30 天内合并 PR
6

描述

When launching a devcontainer, the docker command being logged is not the same command that is actually being passed to docker. This is due to the logger replacing everything after the new line with an empty space: https://github.com/devcontainers/cli/blob/a48200c005724ddaecae3ed6b188a7d99ca482a4/src/spec-common/commonUtils.ts#L329
and the arguments containing a new lines https://github.com/devcontainers/cli/blob/a48200c005724ddaecae3ed6b188a7d99ca482a4/src/spec-node/singleContainer.ts#L381

Ideally the command being logged should be exactly what is being passed to docker.

Current log output of the command:
```
docker run --sig-proxy=false -a STDOUT -a STDERR --mount source=/dev,target=/workspace,type=bind --mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker-host.sock -l devcontainer.local_folder=/dev -l devcontainer.config_file=/dev/.devcontainer/devcontainer.json --entrypoint /bin/sh vsc-c5067b6e1911c7c50ffae27b6e3a0b6304f4375a5b0021508f278d172f3835a8-features-uid -c echo Container started
```

when the actual docker execution is:
```
docker run --sig-proxy=false -a STDOUT -a STDERR --mount source=/dev,target=/workspace,type=bind --mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker-host.sock -l devcontainer.local_folder=/dev -l devcontainer.config_file=/dev/.devcontainer/devcontainer.json --entrypoint /bin/sh vsc-c5067b6e1911c7c50ffae27b6e3a0b6304f4375a5b0021508f278d172f3835a8-features-uid -c echo Container started
trap "exit 0" 15
/usr/local/share/docker-init.sh
exec "$@"
while sleep 1 & wait $!; do :; done -
```

It would be nice to format the log correctly to make it easy to recreate the container for testing

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。