使用docker-compose时出现 Interactive shell

版权声明:程序员小鱼 https://blog.csdn.net/u012664888/article/details/81587173

使用docker-compose起不来一个php-fpm容器,代码如下:

php_wordpress:
  image: daocloud.io/library/php:7.2.8-fpm-stretch
  container_name: php_wordpress
  ports:
    - "9000:9000"
  volumes:
    - /wwwroot/site/wordpress:/var/www/html
  stdin_open: true
  tty: true

如果不加入 stdin_open 和 tty 这二行代码会导致容器起不来,并且docker logs php_wordpress 后出现:

Interactive shell

这二行代码才能解决问题:
大概意思是:

The first corresponds to -i in docker run and the second to -t.

猜你喜欢

转载自blog.csdn.net/u012664888/article/details/81587173