使用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.
Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐