# 前两天单位的mongo-docker突然无法启动了

* 抖音：<https://v.douyin.com/SRQM9Up/>
* B站：<https://www.bilibili.com/video/BV1HT411U7Vf/>

前两天单位一个mongo的docker起不来了

今天用虚拟机给大家复现一下

我觉得挺好玩啊

首先呢我们来看一下docker ps

现在什么容器都没起

然后呢我们再加一个 "-a"

这有一个mongo的容器

我们尝试把它启动起来：docker start

现在看上去好像启动起来了对吧

但是我们在docker ps一下他还是没起来

所以呢我们再来倒克看一下他的日志

logs

大家看，日志里边

像这种s等于i的都不用管

这是info

我们来看这种error的

它提示一个这个文件

没有权限

所以呢它应该是docker

或者这个容器异常终止了

导致容器内部的这个文件没有

注意这个是Docker容器内部的文件

所以呢后来我就在想

怎么能在不启动容器的情况下

去操作容器里边的文件

后来呢我发现可以这样哈：docker inspect

然后呢把这个容器ID拿过来

然后呢

我们在这里边找一种配置叫MergeDIR

大家看：这有一个路径

我们进到这个路径

cd ...

好没有权限

我们回到root

好

cd

大家看

这里边有一个tmp

我们进去

然后tmp里边就有这个文件了

我们把这个文件删掉：rm -rf

好

大家看 没有了

然后呢我们再尝试重启一下

dockor start

还是把这个容器ID拿过来

好我们再PS一下

我再来看一下刚才这个目录

没有了我们再回来

看下这里边还有一个diff

这里边还有一个把这个给删掉

mongo

好

这回没有了

我们再起一下

docker start ...

好我们再PS一下

这回就起来了


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sunzsh.gitbook.io/xiaoshan.bug/qian-liang-tian-dan-wei-de-mongodocker-tu-ran-wu-fa-qi-dong-le.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
