Docker - MySQL容器不能继续运行(Docker - MySQL container does not keep running)

我需要一些帮助在Docker容器中使用MySQL。 我认为Docker的全部意义在于隔离沙箱中的进程并让它们像正常进程一样运行 - 我没有得到这个功能。

每当我运行一个我自己的图像构建的MySQL容器时,它运行2秒钟,然后停止。 尝试使用docker run -i -t <imageid>给我这个:

root@CenturionX:/home/centurionx/Code/Git/gdms-rcon# docker run -i -t e2d
150221 05:25:21 mysqld_safe Logging to '/var/lib/mysql/28123b6d1dad.err'.
150221 05:25:21 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150221 05:25:21 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
root@CenturionX:/home/centurionx/Code/Git/gdms-rcon# 

为什么守护进程不能保持打开状态? 我有我的Dockerfile ,看起来像:

# This docker file constructs a MySQL database instance
FROM mysql:latest

ADD . /gdms-rcon/mysql
WORKDIR /gdms-rcon/mysql

ENTRYPOINT ["/usr/bin/mysqld_safe"]

EXPOSE 3306

还有一个fig.yml文件来帮助我自动化构建过程:

mysql:
  build: .
  volumes:
    - .:/gdms-rcon/mysql
  working_dir: /gdms-rcon/mysql
  ports:
    - "3306:3306"
  environment:
    - MYSQL_DATABASE=mydb
    - MYSQL_ROOT_PASSWORD=mypassword

I need some help with using MySQL in a Docker container. I thought the entire point of Docker was to isolate processes in sandboxes and have them run like normal processes - I am not getting this functionality.

Whenever I run a MySQL container that I have built from my own image, it runs for 2 seconds, then stops. Trying docker run -i -t <imageid> gives me this:

root@CenturionX:/home/centurionx/Code/Git/gdms-rcon# docker run -i -t e2d
150221 05:25:21 mysqld_safe Logging to '/var/lib/mysql/28123b6d1dad.err'.
150221 05:25:21 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150221 05:25:21 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
root@CenturionX:/home/centurionx/Code/Git/gdms-rcon# 

Why does the daemon not stay open? I have my Dockerfile, which looks like:

# This docker file constructs a MySQL database instance
FROM mysql:latest

ADD . /gdms-rcon/mysql
WORKDIR /gdms-rcon/mysql

ENTRYPOINT ["/usr/bin/mysqld_safe"]

EXPOSE 3306

And a fig.yml file to help me automate the build process:

mysql:
  build: .
  volumes:
    - .:/gdms-rcon/mysql
  working_dir: /gdms-rcon/mysql
  ports:
    - "3306:3306"
  environment:
    - MYSQL_DATABASE=mydb
    - MYSQL_ROOT_PASSWORD=mypassword

原文:https://stackoverflow.com/questions/28642483
2022-11-07 21:11

满意答案

如果要控制数组何时刷新,请将其包装在outputpanel中,并将其id放在rerender属性中,以导致数据需要更新。 在重新更新每个dom时,我不得不使用此方法重新附加一些自定义jQuery输入侦听器。

<apex:commandButton action="{!something}" rerender="scriptPanel"/>
<apex:outputPanel id="scriptPanel>
  <script>
     d = new Array();
     <apex:repeat value="{!objects}" var="object">
       d.push({
           element1: "{!objects.id}"            
       });
     </apex:repeat>
  </script>
</apex:outputPanel>

If you want to control when your array gets refreshed wrap it in an outputpanel and put its id in the rerender attribute of whatever causes the data to need an update. I had to use this previously to reattach some custom jQuery input listeners when every the dom was re-updated.

<apex:commandButton action="{!something}" rerender="scriptPanel"/>
<apex:outputPanel id="scriptPanel>
  <script>
     d = new Array();
     <apex:repeat value="{!objects}" var="object">
       d.push({
           element1: "{!objects.id}"            
       });
     </apex:repeat>
  </script>
</apex:outputPanel>

相关问答

更多

通过预定的顶点调用visualforce Page(Call visualforce Page through scheduled apex)

您应该在负责该页面的Controller类中执行action方法,而不是“调用”页面。 如果你看一下你提到的页面,你应该在顶部看到类似<apex:page controller="myController" ...其中myController是包含该页面逻辑的类的名称。 除非您所谈论的按钮是标准操作(如保存或删除),否则在该Controller类中定义了一个自定义操作,它通过<apex:commandButton>上的action="..."属性链接到您提到的按钮<apex:commandButt...

Visualforce Apex触发器更新错误记录(Visualforce Apex Trigger updating wrong records)

问题可能如下: masterListB抓取多个帐户的分配 for (Account oAcctB : trigger.old)循环中的代码从不检查是否处于“保持”状态的旧帐户是否为同一帐户 一种解决方案可能是进行以下编辑: /* Old condition replaced: if (oAcctB.current_services__c == 'Hold') { */ if (oAcctB.current_services__c == 'Hold' and oAcctB.Id == oAc...

从visualforce页面获取javascript中的表单字段值(Get values of form field in javascript from a visualforce page)

你可以给它一个id,然后使用document.getElementById()来获取它: <apex:inputCheckbox id="theCheckBox" value="{!Contact.Some_Checkbox__c}" onClick="alert('checked? ' + document.getElementById('{!$Component.theCheckBox}').checked);"/> 请注意,如果它位于其他元素中,您可能需要深入查看它,所以如果它位于<ape...

Visualforce编码Javascript(Visualforce encode Javascript)

JSENCODE函数在Visualforce中可用。 查看http://www.salesforce.com/us/developer/docs/pages/Content/pages_variables_functions.htm 。 如果控制器中有变量jsString ,则可以使用以下命令将字符串设置为JS变量,并使用相应的转义: var myVar = {!JSENCODE(jsString)}; The JSENCODE function is available in Visualfo...

试图在Apex重复中捕获Apex:InputText(Trying to capture Apex:InputText within Apex repeat)

你需要在<apex:repeat>周围放一个<apex:form> <apex:repeat> 。 您的代码将如下所示: <apex:form> <apex:repeat value="{!tList}" var="tvar" id="t4"> <tr id="slxtableData"> <td>{!tvar.ftypename}</td> <td><apex:outputText value="{0, number, 00.00}" ...

如何在VisualForce中创建并行记录比较(How to create side-by-side record comparison in VisualForce)

答案最终非常直接! 首先 - 事实证明, apex:pageBlockTable可以处理传递给value参数的任何类型的对象,无论是SObject数组还是MyFooBar对象数组。 第二 - 我们需要一个包装类来同时封装两个记录: public with sharing class LeadContactCompareWrapper { public static final String SALUTATION = 'Salutation'; public static final...

Visualforce中的Apex SOQL子查询(Apex SOQL subquery in Visualforce)

重编辑...... 我不认为你可以使用标准的控制器。 使用自定义控制器,我能够获得当前用户的综合机会联系人列表: 页: <apex:page controller="TestQueryController"> <apex:form > <apex:pageBlock > <apex:pageBlockTable value="{!opportunities}" var="co"> <apex:column value="{!co.Opportun...

内部时,无法获取的值(Cannot get values of when inside )

如果我做对了你想存入 public list<List<SelectOption>> options {get;set;} 可能的答案。 因此,更好的方法可能是将它存储在Question.Id到List的映射中 public Map<Id,List<SelectOption>> options {get;set;} ... for(COPE_Questions__C q : questions){ ridCount++; List<SelectOption> l = ne...

VisualForce,Apex:重复,用于Javascript数组更新(VisualForce, Apex:Repeat, for Javascript array Update)

如果要控制数组何时刷新,请将其包装在outputpanel中,并将其id放在rerender属性中,以导致数据需要更新。 在重新更新每个dom时,我不得不使用此方法重新附加一些自定义jQuery输入侦听器。 <apex:commandButton action="{!something}" rerender="scriptPanel"/> <apex:outputPanel id="scriptPanel> <script> d = new Array(); <apex:r...

在visualforce中从javascript调用控制器方法(Call a controller method from javascript in visualforce)

您可以通过以下方式为Apex控制器使用JavaScript Remoting : <apex:page standardController="Account" extensions="OrderPadController"> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script> window.$j = jQuery.noConflict(...

相关文章

更多

Docker 容器创建并运行MySQL

下载MySQL镜像:docker pull centos/mysql‐57‐centos7(docke ...

Another MySQL daemon already running with the same unix socket.

两个方法解决: 第一个是立即关机 使用命令 shutdown -h now 关机,关机后在启动,进程就 ...

揭开Docker神秘的面纱-传智播客Docker视频教程

Docker是基于LXC的虚拟化技术,它为IT行业中的运维人员和开发人员都带来了非常大的帮助,对于运维 ...

Running Solr with Maven

Solris an open source search server which is built ...

mysql问题

利用PreparedStatement执行插入,更新的操作时候: 如: PreparedState ...

HDFS patch前后Ganglia看到running processes变化的分析

Ganglia running processes是怎么算出来的?ganglia是通过 cat /pr ...

关于netbeans和mysql的问题

为什么在netbeans里进行数据迁移总说缺少mysql.io这样一个类似的东西, 应该怎么装mys ...

my php & mysql FAQ

php中文字符串长度及定长截取问题使用str_len(&quot;中国&quot;) 结果为6,php ...

最新问答

更多

获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)

我用Google搜索了一个解决方案。 “EnumDisplayModeProvider”是我自己设置网站的各种模式的枚举。 public EnumDisplayModeProvider GetDisplayModeId() { foreach (var mode in DisplayModeProvider.Instance.Modes) if (mode.CanHandleContext(HttpContext)) {

如何通过引用返回对象?(How is returning an object by reference possible?)

这相对简单:在类的构造函数中,您可以分配内存,例如使用new 。 如果你制作一个对象的副本,你不是每次都分配新的内存,而是只复制指向原始内存块的指针,同时递增一个也存储在内存中的引用计数器,使得每个副本都是对象可以访问它。 如果引用计数降至零,则销毁对象将减少引用计数并仅释放分配的内存。 您只需要一个自定义复制构造函数和赋值运算符。 这基本上是共享指针的工作方式。 This is relatively easy: In the class' constructor, you allocate m

矩阵如何存储在内存中?(How are matrices stored in memory?)

正如它在“熵编码”中所说的那样,使用Z字形图案,与RLE一起使用,在许多情况下,RLE已经减小了尺寸。 但是,据我所知,DCT本身并没有给出稀疏矩阵。 但它通常会增强矩阵的熵。 这是compressen变得有损的点:输入矩阵用DCT传输,然后量化量化然后使用霍夫曼编码。 As it says in "Entropy coding" a zig-zag pattern is used, together with RLE which will already reduce size for man

每个请求的Java新会话?(Java New Session For Each Request?)

你是如何进行重定向的? 您是否事先调用了HttpServletResponse.encodeRedirectURL()? 在这里阅读javadoc 您可以使用它像response.sendRedirect(response.encodeRedirectURL(path)); The issue was with the path in the JSESSIONID cookie. I still can't figure out why it was being set to the tomca

css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)

我认为word-break ,如果你想在一个单词中打破行,你可以指定它,这样做可以解决问题: .column { word-break:break-all; } jsFiddle演示。 您可以在此处阅读有关word-break属性的更多信息。 I think word-break, with which you can specify if you want to break line within a word, will do the trick: .column { word-break

无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)

我认为您忘记在分类时间内缩放输入图像,如train_test.prototxt文件的第11行所示。 您可能应该在C ++代码中的某个位置乘以该因子,或者使用Caffe图层来缩放输入(请查看ELTWISE或POWER图层)。 编辑: 在评论中进行了一次对话之后,结果发现在classification.cpp文件中错误地删除了图像均值,而在原始训练/测试管道中没有减去图像均值。 I think you have forgotten to scale the input image during cl

xcode语法颜色编码解释?(xcode syntax color coding explained?)

转到: Xcode => Preferences => Fonts & Colors 您将看到每个语法高亮颜色旁边都有一个简短的解释。 Go to: Xcode => Preferences => Fonts & Colors You'll see that each syntax highlighting colour has a brief explanation next to it.

在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)

你考虑过第三方拼写检查吗? 您可以将在C#中开发的自定义WinForms控件插入访问数据库吗? VB6控件怎么样? 如果你能找到一个使用第三方库进行拼写检查的控件,那可能会有效。 Have you considered a third party spell checker? Can you insert a custom WinForms controls developed in C# into an access database? What about a VB6 control? If

从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)

我有同样的问题,因为我在远程服务器上有两个图像,我需要在每天的预定义时间复制到我的本地服务器,这是我能够提出的代码... try { if(@copy('url/to/source/image.ext', 'local/absolute/path/on/server/' . date("d-m-Y") . ".gif")) { } else { $errors = error_get_last(); throw new Exception($err

从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))

我不确定我完全明白你在说什么。 你能编辑你的帖子并包含你正在做的Subversion命令/操作的特定顺序吗? 最好使用命令行svn客户端,以便容易为其他人重现问题。 如果您只是想获取文件的旧副本(即使该文件不再存在),您可以使用如下命令: svn copy ${repo}/trunk/moduleA/file1@${rev} ${repo}/trunk/moduleB/file1 其中${repo}是您的存储库的URL, ${rev}是您想要的文件的版本。 这将恢复该文件的旧版本,包括最高版本