docker_file/
├── Dockerfile
└── start.sh
#!/bin/bash service ssh start supervisord -c /etc/supervisor/supervisord.conf /bin/bash
#!/bin/bash service ssh start supervisord -c /etc/supervisor/supervisord.conf /bin/bash gzfs@gzfs-gpu:~/creative_tools_fastapi_project/docker_file$ cat Dockerfile FROM creative_tools_fastapi:v1 COPY ["start.sh", "/home/start.sh"] WORKDIR /home CMD ["sh", "/home/start.sh"]
docker build -t creative_tools_fastapi:latest .
注意这里不能跟/bin/bash因为会覆盖前面的CMD命令
docker run -itd --restart=on-failure --name creative_tools_fastapi -p 8100:6100 -p 8200:6200 -p 8022:22 -v /mnt:/mnt creative_tools_fastapi:latest