Skip to content

Instantly share code, notes, and snippets.

@ikbear
Created August 19, 2015 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ikbear/dbb05e1b640ad962f6f6 to your computer and use it in GitHub Desktop.
Save ikbear/dbb05e1b640ad962f6f6 to your computer and use it in GitHub Desktop.
#!/bin/bash
/bin/sh -c "while true; do echo hello world; sleep 1; done"
@ikbear
Copy link
Author

ikbear commented Aug 19, 2015

为了保证 Docker Container 进程不退出,从 Ubuntu 系统镜像启动进程的时候需要执行一个不会退出的命令。如果 /bin/sh 不带上 -c 参数,在宿主系统下无法通过 Ctrl-C 来退出进程。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment