devcontainers / devcontainers/cli

devcontainer up trims docker command in logs

Aperta
#704 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
feature-request
Lingua principale
TypeScript
Stelle
3k
Fork
457
Merge medio
13h 17m
PR unite (30g)
6

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.