我想在Docker容器中运行Symfony 3控制台命令,但无法获得正确的输出。
docker-compose.yaml
version: '3.4'
services:
app:
build:
context: .
target: symfony_docker_php
args:
SYMFONY_VERSION: ${SYMFONY_VERSION:-}
STABILITY: ${STABILITY:-stable}
volumes:
# Comment out the next line in production
- ./:/srv/app:rw,cached
# If you develop on Linux, comment out the following volumes to just use bind-mounted project directory from host
- /srv/app/var/
- /srv/app/var/cache/
- /srv/app/var/logs/
- /srv/app/var/sessions/
environment:
- SYMFONY_VERSION
nginx:
build:
context: .
target: symfony_docker_nginx
depends_on:
- app
volumes:
# Comment out the next line in production
- ./docker/nginx/conf.d:/etc/nginx/conf.d:ro
- ./public:/srv/app/public:ro
ports:
- '80:80'
我的控制台命令
docker-compose exec nginx php bin/console
它返回以下响应
输入设备不是TTY。如果你在使用mintty,请在命令前加上“winpty”。
https://github.com/dunglas/symfony-docker
。 - Abdul Awal$ docker-compose exec -T app php --version PHP 7.2.21 (cli) (built: Aug 20 2019 23:29:01) ( NTS ) 版权所有 (c) 1997-2018 PHP Group Zend Engine v3.2.0,版权所有 (c) 1998-2018 Zend Technologies 带有Zend OPcache v7.2.21,版权所有 (c) 1999-2018,由Zend Technologies提供 带有Xdebug v2.6.0,版权所有 (c) 2002-2018,由Derick Rethans提供
- Abdul Awal