如果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