如果docker-compose.yml如下,则用docker-compose up -d启动起来的容器可能会立即停止。
version: '2'
services:
mir-http-repo:
image: 172.16.101.192/mir_docker/centos6.7_repo_jinzhong:v1.0
container_name: mir-http-repo
ports:
- 8088:8088
解决办法:加上tty为true
version: '2'
services:
mir-http-repo:
image: 172.16.101.192/mir_docker/centos6.7_repo_jinzhong:v1.0
container_name: mir-http-repo
ports:
- 8088:8088
tty: true