Is it possible to combine “docker logs” output and “docker exec” output?

后端 未结 1 1859
孤街浪徒
孤街浪徒 2021-01-07 03:15

Is it possible that merging docker logs -f output and docker exec result? I already tried to redirect docker exec results to doc

相关标签:
1条回答
  • 2021-01-07 03:53

    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

    0 讨论(0)
提交回复
热议问题