在Docker容器中使用管道运行内联命令

gc5*_*gc5 5 bash pipe command-line-interface docker

我想在Docker容器中运行一组命令,例如:

docker run -i <image> cmd1 | cmd2
Run Code Online (Sandbox Code Playgroud)

两者cmd1cmd2都应在容器内运行。

可能吗?如果没有,有哪些替代方案?