我有一个在 shell 中完美运行的命令:
启动-停止-守护进程 --quiet --oknodo --start --pidfile /run/my.pid --background --make-pidfile --exec /opt/socat-1.7.2.4/socat PTY,link=/dev /ttyMY,echo=0,raw,unlink-close=0 TCP-LISTEN:9334,reuseaddr,fork
现在我想在启动时从 docker 容器运行这个命令。所以在 Dockerfile 的底部我有:
CMD ["bash", "start-stop-daemon", "--quiet", "--oknodo", "--start", "--pidfile", "/run/myprocess.pid", "--背景”、“--make-pidfile”、“--exec”、“/opt/socat-1.7.2.4/socat”、“PTY,link=/dev/ttyPROCESS,echo=0,raw,unlink-close= 0", "TCP-LISTEN:9334,reuseaddr,fork"]
但是容器退出并出现错误:
/sbin/start-stop-daemon: /sbin/start-stop-daemon: cannot execute binary file
我认为 CMD 语法有问题。有任何想法吗?