docker-compose up 退出问题
来源:6-3 Docker Compose的安装和基本使用
secrethaha
2018-12-05
老师您好 我用的虚拟机 centos 7 按照您的docker-compose。yml 文件构建容器
docker-compose up
Creating network “wordpress_my-bridge” with driver "bridge"
Creating volume “wordpress_mysql-data” with default driver
Pulling mysql (mysql:5.7)…
5.7: Pulling from library/mysql
f17d81b4b692: Pull complete
c691115e6ae9: Pull complete
41544cb19235: Pull complete
。。。。。。
。。。。。。
wordpress_1 | AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 172.18.0.3. Set the ‘ServerName’ directive globally to suppress this message
wordpress_1 | AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 172.18.0.3. Set the ‘ServerName’ directive globally to suppress this message
wordpress_1 | [Wed Dec 05 02:29:37.659567 2018] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.25 (Debian) PHP/7.2.12 configured – resuming normal operations
wordpress_1 | [Wed Dec 05 02:29:37.659661 2018] [core:notice] [pid 1] AH00094: Command line: ‘apache2 -D FOREGROUND’
^CGracefully stopping… (press Ctrl+C again to force)
Stopping wordpress_wordpress_1 …
Stopping wordpress_mysql_1 …
Stopping wordpress_wordpress_1 … done
Stopping wordpress_mysql_1 … done
我看您视频说按ctr +c 就可以退出 我退出了 用docker-compose ps 查看 这两个容器也退出了。。。这是为什么。
docker-compose ps
Name Command State Ports
wordpress_mysql_1 docker-entrypoint.sh mysqld Exit 0
wordpress_wordpress_1 docker-entrypoint.sh apach … Exit 0
1回答
-
您好,ctrl+c会让这些容器退出的。如果您想让这些容器后台运行,那么您docker-compose up的时候加上 -d参数,让容器后台运行。
012018-12-07
相似问题