duanqinjiao5244 2017-10-25 07:49
浏览 456

Docker容器崩溃-之后管理容器出现问题

I run:

  • docker: Docker version 17.03.0-ce, build 60ccb22
  • linux: Ubuntu 16.04.2 LTS

Image inside docker container runs some golang app, which (I found this know) wasn't properly dealing with errors. I should include os.Exit(1) for cases like mine, for error checking.

I run/start docker container with command like

docker run -it --restart=always --env-file ~/PRODUCTION/services/resolvment_api/.environmet_variables -p 8081:3003 --name resolvment_2 -d resolvment-api

Ok, then it looks like an error occur inside a docker container on app level. At this point something strange happens to docker/docker container.

If i do docker ps I can see

2e7b02258647 resolvment-api "/bin/sh -c $GOBIN..." 9 days ago Up 37 hours 0.0.0.0:8081->3003/tcp resolvment_2

  1. I can do docker logs 2e7b02258647 and will see logs.

  2. If I try to do docker stop 2e7b02258647 I get container id in next line as usually when you successfully stop a container. Then if i do docker ps again... I can still see docker container (with same id) listed there?!

  3. If I then try to forcefully remove the container with docker rm -f 2e7b02258647 I get an error Error response from daemon: Unable to remove filesystem for 2e7b02258647ec357fd1beb0083ad678eb381474f1315b3e524d318472c5f061: remove /var/lib/docker/containers/2e7b02258647ec357fd1beb0083ad678eb381474f1315b3e524d318472c5f061/shm: device or resource busy but docker container is not listed anymore under docker ps.

  4. Then I want to add/start again the container with command docker run -it --restart=always --env-file ~/PRODUCTION/services/resolvment_api/.enviroment_variables -p 8081:3003 --name resolvment_2 -d resolvment-api

and the error that i get as response is this: fc174f65cc34a2573563729acfe11436370ab08965be553e682d82e7af06b236 docker: Error response from daemon: service endpoint with name resolvment_2 already exists.

so i do docker rm resolvment_2, and try to start again... but same error.

if i put -f with rm command... doesn't help either.

So, rm/run/rm/run.... walking in circle... doesn't help.

And I can't just restart docker daemon, since there are few other containers running.

Would really aprechiate some help on this.

Best, Tomaz

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 python的qt5界面
    • ¥15 无线电能传输系统MATLAB仿真问题
    • ¥50 如何用脚本实现输入法的热键设置
    • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
    • ¥30 深度学习,前后端连接
    • ¥15 孟德尔随机化结果不一致
    • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
    • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
    • ¥15 谁有desed数据集呀
    • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100