如何在docker容器中重新启动颤振应用程序?
我正在尝试重新启动在Docker中运行的颤振应用程序。 我在docker-compose.yml文件中将stdin\u open和tty指定为true如何在docker容器中重新启动颤振应用程序?,docker,flutter,docker-compose,Docker,Flutter,Docker Compose,我正在尝试重新启动在Docker中运行的颤振应用程序。 我在docker-compose.yml文件中将stdin\u open和tty指定为true 这是docker-compose.yml中唯一指定stdin和tty的地方 app: build: context: app restart: always stdin_open: true tty: true volumes: - ./app:/build ports: - "8080
- 这是docker-compose.yml中唯一指定stdin和tty的地方
app: build: context: app restart: always stdin_open: true tty: true volumes: - ./app:/build ports: - "8080:8080" env_file: - ./env/flutter.env command: > sh -c "flutter pub get && flutter run -d web-server --web-port 8080 --web-hostname 0.0.0.0" depends_on: - server
docker attach <container>
docker连接
按
R
。按Ctrl-P
Ctrl-Q
分离。您显示的docker compose
命令是执行此操作的正常方式。好的,我理解。谢谢,它也不起作用。结果与before@Wiktor你能提供一些hello world代码让我自己运行Flitter吗?这是最简单的一个主文件,但是您需要更多的文件来构建它。使用Flatter sdk,您可以运行Flatter create
来创建一个准备运行的Flatter模板。@Wiktor我曾多次尝试使用docker compose
使其工作,但失败。似乎它唯一转发的是过程信号。另一方面,我在上面发布的解决方案运行良好:。我尝试了几种启动配置,按R重新启动没有问题。哦,对不起。这很有效,没错。我必须在它开始在浏览器中运行之前附加它。非常感谢你