主要依靠的一个开源软件runlike

See runlike-github

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13

yum clean all
yum makecache

yum install python-pip python-setuptools -y

pip install runlike

# 若此时正在运行的一个容器为`redis`
# 则
runlike redis > redis_start.sh
# 此时redis_start.sh即为docker启动redis容器的命令