是否可以在Docker容器内安装复杂的服务器? [英] Is it possible to install a complex server inside a Docker container?

查看:142
本文介绍了是否可以在Docker容器内安装复杂的服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看来Docker更适合于单进程应用程序和服务,但是它能够为更复杂的应用程序(具有多个进程,侦听端口,大量存储空间使用)提供稳定的控制?

It appears that Docker is better suited for single process applications and services, but is it capable to offer a stable containment for a more complex application ( that has multiple processes, listening ports, considerable storage usage ) ?

推荐答案

是的!您可以使用Supervisor,monit,runit或甚至真正的init系统(包括upstart或systemd)来运行多个进程。你甚至可以使用一个便宜的shell脚本,如下所示:

Yes! You can use Supervisor, monit, runit, or even a "real" init system (including upstart or systemd) to run multiple processes. You can even use a cheap shell script like the following:

#!/bin/sh
( while true; do run-process-1; done; ) &
( while true; do run-process-2; done; ) &
wait

这篇关于是否可以在Docker容器内安装复杂的服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆