请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

docker-compose up 退出问题

老师您好 我用的虚拟机 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参数,让容器后台运行。

登录后可查看完整回答登录/注册
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信