即使对于 docker 环境,Supervisord 也是非常棒的工具。它对 stderr 重定向和信号转发有很大帮助。但它有几个缺点:
docker ps -a那么,supervisord 的最佳替代品是什么?
最佳答案
针对“PID1 僵尸收割”问题,我之前(在“Use of Supervisor in docker”中)建议使用 runit instead of supervisord
Runit uses less memory than Supervisord because Runit is written in C and Supervisord in Python.
And in some use cases, process restarts in the container are preferable over whole-container restarts.
见 phusion/baseimage-docker更多图片。
如 Torsten Bronger 所述在 the comments :
Runit is not there to solve the reaping problem.
Rather, it's to support multiple processes. Multiple processes are encouraged for security (through process and user isolation).
自 2015 年起,您现在可以 Specify an init process that should be used as the PID 1 in the container, with docker run --init
The default
initprocess used is the firstdocker-initexecutable found in the system path of the Docker daemon process.
Thisdocker-initbinary, included in the default installation, is backed bytini.
关于docker - docker的supervisord的替代品,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33850460/
在MRIRuby中我可以这样做:deftransferinternal_server=self.init_serverpid=forkdointernal_server.runend#Maketheserverprocessrunindependently.Process.detach(pid)internal_client=self.init_client#Dootherstuffwithconnectingtointernal_server...internal_client.post('somedata')ensure#KillserverProcess.kill('KILL',
“输出”是一个序列化的OpenStruct。定义标题try(:output).try(:data).try(:title)结束什么会更好?:) 最佳答案 或者只是这样:deftitleoutput.data.titlerescuenilend 关于ruby-on-rails-更好的替代方法try(:output).try(:data).try(:name)?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.c
1.错误信息:Errorresponsefromdaemon:Gethttps://registry-1.docker.io/v2/:net/http:requestcanceledwhilewaitingforconnection(Client.Timeoutexceededwhileawaitingheaders)或者:Errorresponsefromdaemon:Gethttps://registry-1.docker.io/v2/:net/http:TLShandshaketimeout2.报错原因:docker使用的镜像网址默认为国外,下载容易超时,需要修改成国内镜像地址(首先阿里
我正在使用DMOZ的listofurltopics,其中包含一些具有包含下划线的主机名的url。例如:608609TheOuterHeaven610InformationandimagegalleryofMcFarlane'sactionfiguresforTrigun,Akira,TenchiMuyoandotherJapaneseSci-Fianimations.611Top/Arts/Animation/Anime/Collectibles/Models_and_Figures/Action_Figures612虽然此url可以在网络浏览器中使用(或者至少在我的浏览器中可以使用:
你知道jrails的替代品吗?它或多或少已经过时(使用jQuery1.5-现在1.7是当前版本)。有人知道替代方案吗?谢谢编辑:我知道如何使用jqueryallone构建rails助手-但我喜欢rails助手,所以我不想单独使用jquery(没有jrails) 最佳答案 我一直在Rails中使用Prototype助手,最近我决定转而使用JQuery。起初我查看了JRails,因为它是一个直接替代品,因此需要最少的工作。但是!在阅读了更多关于JQuery的信息并尝试使用它之后,我逐渐明白,结合使用Rails和JQuery的最佳方式就是
我有一个RubyOnRails3项目,我正在使用rvm。我想从sysvinit脚本切换到supervisord。sysvinit脚本只能在出现错误时启动软件,它会被$something杀死并重新启动。主要是我。在项目文件夹中有一个.ruby-version和一个.ruby-gemset文件,以便自动加载正确的ruby版本和gemset。然后应用程序开始使用如下所示的shell脚本:#!/bin/bashRAILS_ENV="production"railsserver-d我的init脚本看起来像这样,除了重新启动和停止之外还可以工作:#!/bin/sh###BEGININITINF
我正在尝试使用docker运行一个Rails应用程序。通过github的sshurl安装的gem很少,如下所示:Gemfilegem'swagger-docs',:git=>'git@github.com:xyz/swagger-docs.git',:branch=>'my_branch'我在docker中添加了keys,它能够克隆所需的repo并从git安装gem。DockerfileRUNmkdir-p/root/.sshCOPY./id_rsa/root/.ssh/id_rsaRUNchmod700/root/.ssh/id_rsaRUNssh-keygen-f/root/.ss
关闭。这个问题不符合StackOverflowguidelines.它目前不接受答案。要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于StackOverflow来说是偏离主题的,因为它们往往会吸引自以为是的答案和垃圾邮件。相反,describetheproblem以及迄今为止为解决该问题所做的工作。关闭9年前。Improvethisquestion我想知道是否有人知道Ruby的rubyzip替代品,它可以处理各种格式,特别是zip/rar/7z?我知道libarchive,但它对我的目的来说并不完整(它是一个很好的gem)。(澄清一下,libarchive-对我不起作用-因为
我爱Sanitize.这是一个了不起的实用程序。我遇到的唯一问题是,它需要永远准备一个开发环境,因为它使用Nokogiri,这对编译时间来说是一种痛苦。是否有任何程序可以在不使用Nokogiri的情况下执行Sanitize的操作(如果没有别的,只是温和地执行它的操作)?这将以指数方式提供帮助! 最佳答案 Rails有自己的SanitizeHelper。根据http://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html,它将Thissanitizehe
我在Heroku上构建了一个必须在Docker容器内运行的RoR应用程序。为此,我使用officialDockerfile.因为它在Heroku中很常见,所以我需要一些附加组件才能使这个应用程序完全运行。在生产中,变量DATABASE_URL在我的应用程序中可用。但是,如果我尝试其他一些使用环境变量(在我的例子中是Mailtrap)的加载项,变量不会在运行时复制到实例中。所以我的问题很简单:如何让docker实例在Heroku上执行时知道环境变量?您可能会问,我已经知道我们可以在docker-compose.yml中指定一个environment指令。我想避免这种情况,以便能够通过项目