Linux 在入口点执行sh命令

Linux 在入口点执行sh命令,linux,bash,docker,Linux,Bash,Docker,我从minio/mc创建了一个图像,我希望容器中的cat文件可以制作类似这样的东西 docker run -it --entrypoint='sh cat hello.txt' my/miniomc > hello.txt 如何编写此cat是要执行的sh命令 在我的情况下,我不能使用docker cp 感谢您的帮助entrypoint参数需要一个二进制文件 试试这个: docker run --rm -it --entrypoint=/bin/cat my/miniomc hello.t

我从minio/mc创建了一个图像,我希望容器中的cat文件可以制作类似这样的东西

docker run -it --entrypoint='sh cat hello.txt' my/miniomc > hello.txt
如何编写此cat是要执行的sh命令

在我的情况下,我不能使用
docker cp


感谢您的帮助

entrypoint参数需要一个二进制文件

试试这个:

docker run --rm -it --entrypoint=/bin/cat my/miniomc hello.txt > hello.txt

您还可以通过
docker run-d my/miniomc cat hello.txt>hello.txt
来实现这一点。您想只使用entrypoiny吗?猫是命令?