首页 \ 问答 \ 如何在Docker中获取Docker容器ID?(How to get docker container ID within Docker?)

如何在Docker中获取Docker容器ID?(How to get docker container ID within Docker?)

我试图按照这里说明运行Jupyter Notebook,它不是预构建的Docker容器的一部分。

为了得到包含id,我在Docker Quickstart Terminal中做了这个,当笔记本服务器用Ctrl + C终止时(笔记本服务器运行时没有响应),我得到了

$ docker ps -lq
0a8f14a15b4f

然后我做到了

$ docker exec -it 0a8f14a15b4f bash
Error response from daemon: Container 0a8f14a15b4f357352f3c40b6d449e1d9150a0ce79
5fd81c09c00e978ea86163 is not running

那么发生了什么? 我该如何获得容器ID,以便我可以做下面的事情?

docker exec -it [container-id] bash

谢谢!


I am trying to follow the instructions here in order to run a Jupyter Notebook that's not part of a prebuilt Docker container.

In order to get the contain id, I did this in Docker Quickstart Terminal when the notebook server is terminated with Ctrl + C (no response when the notebook server is running), I got

$ docker ps -lq
0a8f14a15b4f

Then I did this

$ docker exec -it 0a8f14a15b4f bash
Error response from daemon: Container 0a8f14a15b4f357352f3c40b6d449e1d9150a0ce79
5fd81c09c00e978ea86163 is not running

So, what is going on? How am I supposed to get the container id so that I can do something like below?

docker exec -it [container-id] bash

Thanks!


原文:https://stackoverflow.com/questions/41817649
更新时间:2023-06-04 18:06

最满意答案

对此唯一的“解决方法”是使用传统的解析器,它构建了MPS风格的AST。

投影编辑器从各种解析问题中获取MPS(考虑用于C的MPS样式编辑器),代价是无法解析。 每种技术选择都有好处和成本。


The only "workaround" for this is the use of a conventional parser, that builds an MPS-style AST.

The projectional editor gets MPS out of all kinds of parsing troubles (consider an MPS-style editor for C), at the price of not being able to parse. Every technology choice has benefits and costs.

相关问答

更多
  • 如果您使用多个不具有事件相关性的OpenCL命令队列,则OpenCL运行时可以通过各个队列的不同工作来保持GPU内核忙碌。 这实际上是否真的发生在真正的实施中。 您需要检查每个供应商的OpenCL指南,看看它们是否支持并发GPU内核。 If you use multiple OpenCL command queues that don't have event interdependencies, an OpenCL runtime could keep the GPU cores busy with va ...
  • 我在原始文件夹中有文本文件,我想在我的应用程序中使用 我假设“原始文件夹”表示项目中的res/raw/ resource目录。 我不知道如何告诉扫描仪扫描这个特定的文件 那是因为没有档案。 该文件存在于您的开发计算机上。 在运行时表示原始资源就是:原始资源。 在封面下,它实际上是ZIP文件中的条目。 您需要获取原始资源的R.raw值,然后使用getResources().openRawResource()来获取可以传递给Scanner的InputStream 。 除非您针对不同的配置(例如,语言)使用这些原 ...
  • 对此唯一的“解决方法”是使用传统的解析器,它构建了MPS风格的AST。 投影编辑器从各种解析问题中获取MPS(考虑用于C的MPS样式编辑器),代价是无法解析。 每种技术选择都有好处和成本。 The only "workaround" for this is the use of a conventional parser, that builds an MPS-style AST. The projectional editor gets MPS out of all kinds of parsing tr ...
  • 在MPS术语中,我们称这些实体不是模型而是“根节点”。 你当然可以生成这样的节点组合 - 我可能会使用预处理脚本来生成六个组合作为引用原始实体的新根节点。 它的概念可能看起来像这样: concept TemporaryCombination extends BaseConcept ... references: page:Page[1] entity:Entity[1] ...然后,TemporaryCombination概念的根映射规则可以驱动目标节点的生成。 In MPS terminology we ...
  • 令牌部分是一个身份验证令牌,因此只要该证书集有效(直到您撤销它),它就会起作用。 但是,您仍应将该令牌作为机密管理。 如果您打算与其他人共享此C#程序,则不应与他们共享您的令牌,因为这将使他们能够访问您GitHub帐户的其他部分。 如果要公开共享此文件,则应将其发布到公共CDN或提供访问控制的其他服务。 例如,您可以将带有签名URL的Amazon S3用于每月几美分。 The token part is an auth token so it will work as long as that set of ...
  • 当然:有几种方法。 第一个是为MPS定义自定义持久性机制。 这意味着您将能够以MPS打开,编辑和保存文件,保持当前格式。 但是,如果这样做,您将失去MPS的一些灵活性,因为当您扩展语言或将语言与其他语言结合时,您将不得不修改持久性机制。 我建议简单地解析你的文件,构建一个抽象语法树并在MPS中创建相应的节点。 这里有一个教程,展示如何使用ANTLR解析器导入MPS中的文件: http : //tomassetti.me/antlr-and-jetbrains-mps-parsing-files-and-di ...
  • apache ant loadfile任务将允许读取您的文本文件,并将其内容放入app.updatenotes属性中。 你可以简单地使用: 然后,像以前一样使用filterchain 。 loadresource有一些选项,例如控制文件的编码,或者控制文件不存在或不可读的方式。 The apache ant loadfile task ...
  • 据我所知,eclipse并不知道它已更新,所以 Right click on a project -> refresh. 如果这没有帮助尝试 Project -> Clean Problem fixed, it was happening in the Searchable Dictionary (sample application from Android), the fix is simply to increment the database version when it's changed, ...
  • 确实你的MPS文件有问题。 RHS部分中的行应该有一个名称,例如 RHS RHS1 K 20.9 RHS1 N 20.9 RHS1 ONE 1 基本上,求解器选择一个RHS集。 类似于RANGES部分。 我不确定您打算使用RANGES部分中的线条。 Indeed your MPS file has a problem. The lines in the RHS section should have one ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)