Is it possible that merging docker logs -f
output and docker exec
result?
I already tried to redirect docker exec
results to docker logs
file. My environment that host is MacOS and run ubuntu docker image.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can run
docker exec -it <container id> sh -c "ls -alh > /proc/1/fd/1"
sh -c
is required so that your shell doesn't interpret the redirection