Tag: supervisord

集装箱模式的最佳实践

我使用https://hub.docker.com/r/tiangolo/uwsgi-nginx图像docker化Python webapp,该图像使用supervisor来控制uWSGI实例。 我的应用程序实际上需要一个额外的主pipe介导的过程来运行(LibreOffice无头,我通过appy模块生成文档),我想知道什么是适当的模式来实现它。 我看到的方式,我可以扩展上面的图像与额外的主pipeconfiguration我的需要(以及所有必要的操作系统级别的安装步骤),但这将是矛盾的一般原则运行最less量的独特在给定的容器中的进程。 但是,由于我的Python应用程序只能在本地与LibreOffice进行交stream,所以我不确定如何以更集装箱的方式实现它。 感谢您的任何帮助或build议。

在Linux容器内使用supervisord启动vncserver

我试图启动vncserver使用supervisord在启动时间的lxc容器(我不认为是一个容器是相关的)。 问题是机器以root身份启动。 我的supervisord程序部分如下所示: [program:vnc] directory=/ user=ubuntu environment=HOME="/home/ubuntu",USER="ubuntu" priority=901 command=/usr/bin/vncserver -fg -geometry 1024×768 :1 但是,我发现日志文件显示它试图创build一个密码,虽然已经在/home/ubuntu/.vnc/passwd中存在一个密码 想知道我是否失去了一些东西? 运行命令之前,用户是不是应该更改用户$ HOME和$ USER?

pipe理员curl命令失败,退出56错误

我有这个curlcmd我本地在OSX上成功完成: curl -XPOST http://192.168.59.103:9200/inventoryindex {"acknowledged":true} 但是当它从dockerpipe理员运行它失败… ummmmm 2014-08-16 14:24:38,838 INFO supervisord started with pid 1 2014-08-16 14:24:39,842 INFO spawned: 'curl' with pid 9 2014-08-16 14:24:39,843 INFO spawned: 'elasticsearch' with pid 10 2014-08-16 14:24:39,844 INFO spawned: 'sshd' with pid 11 2014-08-16 14:24:39,853 INFO exited: curl (exit status 56; not expected) 我已经尝试了几个不同的命令的变体,结果相同:以下是supervisor命令的最新版本: [program:curl] command=curl –header "Content-Type:application/json" -XPOST […]

Supervisord运行瓶应用程序调用docker应用程序

我有一个应用程序,使用subprocess进程调用我的dockerized应用程序。 @app.route('/detect', methods=['POST']) def detect_file(): file = request.files['wireframe'] if file and allowed_file(file.filename): filename = str(uuid.uuid4()) + getFileExtension(file.filename) file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename)) p = subprocess.Popen(["docker","run","-v","/home/ganaraj/contours/upload:/detect","-w", "/detect","-it","–rm","opecv3", "./prediction", filename ], stdout=subprocess.PIPE) output, err = p.communicate() return jsonify(result=output.rstrip()) return jsonify(error='Mismatch file type') 当我运行它自己的python app.py烧瓶应用程序,它工作得很好。 我从dockerized应用程序得到一个结果。 当我运行使用gunicorn gunicorn wsgi.py的烧瓶应用程序,它也能正常工作。 当我通过gunicorn运行烧瓶应用程序,并使用主pipe保持发展 – 应用程序启动 – API的工作通常除了DOCKERIZED部分。 我猜这与某种types的权限有关,但我无法弄清楚我需要做什么来解决这个问题。 这里是我的supervisord.conf供参考。 [program:cvupload] command = /root/anaconda/envs/cvuload/bin/gunicorn -b […]

在启动时pipe理容器依赖关系

我有以下设置: PostgreSQL的 为它飞行 应用 我需要按照以下方式链接它们:Flyway等待DB启动,App等待飞行路线完成迁移。 我想过使用etcd来发布一些密钥,其他容器等待它们。 所以,基本上,每个容器的入口点应该是这样的: #!/bin/bash status=1 while $status != 0; do for kv in $DEPENDENT_KEYS: # curl to etcd, get the key if $value == true then status = 0; else status = 1; fi; done; # container-related startup # post to etcd that container is ready # get back to _container-related […]

我怎样才能在DockerFile中定义我的ENVvariables,并将其传递给由supervisord托pipe脚本提交的spark图像?

我正在构build一些Docker Spark图像,对于如何将DockerFile中定义的环境(ENV)variables一直向下传递到容器,通过“run -e”进入supervisord,然后进入spark,我有点困惑- 提交shell,而不必在supervisord.conf文件中再次对它们进行硬编码(这似乎是在这里有点类似的build议: supervisord环境variables设置应用程序 )。 为了帮助解释,想象下面的组件: DockerFile(包含大约20个环境variables“ENV FOO1 bar1”等) run.sh(docker run -d -e my_spark_program) conf / supervisord.conf([program:my_spark_program] command = sh /opt/spark/sbin/submit_my_spark_program.sh等) submit_my_spark_program.sh(包含我想运行的jar的spark提交 – 可能还需要类似–files•–conf'spark.executor.extraJavaOptions = -Dconfig.resource = app'•–conf'spark。 driver.extraJavaOptions = -Dconfig.resource = app',但是这看起来不太合适?) 我想我想在DockerFile中定义我的ENVvariables一次,并且我认为应该可以通过使用“-e”开关的run.sh将它们传递到容器中,但是我似乎无法了解如何将它们从那里传递到supervisord和超出spark-submit shell(submit_my_spark_program.sh),以便它们最终可用于我的spark提交的jar文件。 这似乎有点过度devise,所以也许我在这里失去了一些东西…?

如何停止在前台dockerized nginx淹没日志?

我在一个由supervisordpipe理的docker容器中运行nginx和独angular兽。 所以,supervisord是docker的命令。 它反过来产生nginx和独angular兽。 独angular兽通过套接字与nginx交谈。 nginx监听端口80。 我也有一个logspout泊坞窗容器运行,基本上通过监听docker.sock将所有的docker日志传送到papertrail。 问题是nginx正在不断向成千上万的日志input日志: 172.31.45.231 – – [25/May/2016:05:53:33 +0000] "GET / HTTP/1.0" 200 12961 0.0090 我试图禁用它。 到目前为止我已经: 设置access_logs /dev/null; 在nginx.conf和vhost文件中。 试图告诉supervisord停止logging请求 [program:nginx] command = bash -c“/ usr / sbin / nginx -c /etc/nginx/nginx.conf”stdout_logfile = / dev / null stderr_logfile = / dev / null 试图告诉supervisord发送日志到syslog不是标准输出: [program:nginx] command = bash -c“/ usr / […]

在pipe理员下运行docker,不能启用tty错误

我正试图在主pipe下运行一个启动容器,目前看起来像这样 [program:api] directory=/api/ command=/usr/bin/docker run -it –name api –env-file ./api/api.env –rm -p 8080:8080 588n8b6d7cbd autostart=true autorestart=true redirect_stderr=true stdout_logfile=/var/log/supervisor/supervisor-docker-api-out.log stderr_logfile=/var/log/supervisor/supervisor-docker-api-err.log priority=1 当我这样做时,我得到进程失败运行,我得到下面的错误 cannot enable tty mode on non tty input 如果我删除了-it选项,那么进程运行良好,但是,当我告诉主pipe停止时,实际的docker容器仍在运行。 我不能以任何方式修改图像,所以不能在这里得到方法closures通过主pipe的Docker容器来帮助我。 我在ubuntu 14.04上使用docker 1.11.2。 谢谢

如何将systemctl命令转换为supervisord命令

我find了下面的Dockerfile FROM centos # following http://www.pacb.com/wp-content/uploads/2015/09/SMRT-Analysis-Software-Installation-v2.3.0.pdf MAINTAINER harekrishna@gmail.com ENV SMRT_ROOT=/opt/smrtanalysis/ ENV SMRT_USER=smrtanalysis ENV SMRT_GROUP=smrtanalysis RUN yum groupinstall -y "Development Tools" RUN yum install -y redhat-lsb net-tools RUN groupadd $SMRT_GROUP RUN adduser \ –gid $SMRT_GROUP \ –home-dir $SMRT_ROOT \ –create-home \ –shell /bin/bash \ $SMRT_USER USER $SMRT_USER WORKDIR $SMRT_ROOT RUN curl -LO -# \ http://files.pacb.com/software/smrtanalysis/2.3.0/smrtanalysis_2.3.0.140936.run RUN […]

Docker上的WordPress:mysqld进入了FATAL状态,太多的启动重试太快

我能够用默认的设置运行一个Docker容器。 然后我在主机上find共享卷: -v ~/workspace/mysql:/var/lib/mysql -v ~/workspace/www:/usr/share/nginx/www 这些参数导致supervisord退出正在运行的mysql进程没有额外的信息: 2017-03-08 06:49:59,081 INFO已退出:mysqld(退出状态1;未预期) 2017-03-08 06:50:00,082 INFO放弃了:mysqld进入了FATAL状态,太多的启动重试太快 mysql日志文件是空的使用这些命令: $ docker exec CONTAINER_ID cat /var/log/mysql.log $ docker exec CONTAINER_ID cat /var/log/mysql.err 安慰: $ sudo docker run -p 8082:80 -v ~/workspace/mysql:/var/lib/mysql -v ~/workspace/www:/usr/share/nginx/www –name docker-wordpress-nginx eugeneware/docker-wordpress-nginx /usr/local/lib/python2.7/dist-packages/supervisor-3.1.3-py2.7.egg/supervisor/options.py:296: UserWarning: Supervisord is running as root and it is searching for its configuration file […]