devcontainers / devcontainers/cli

devcontainer up trims docker command in logs

Abierto
#704 3 comentarios 0 reacciones 0 asignados Ver en GitHub
feature-request
Lenguaje dominante
TypeScript
Estrellas
3k
Forks
457
Merge medio
13 h 17 min
PR fusionados (30 d)
6

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.