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 perl MISA分析p3_in脚本出错
    • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
    • ¥15 ubuntu虚拟机打包apk错误
    • ¥199 rust编程架构设计的方案 有偿
    • ¥15 回答4f系统的像差计算
    • ¥15 java如何提取出pdf里的文字?
    • ¥100 求三轴之间相互配合画圆以及直线的算法
    • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
    • ¥15 名为“Product”的列已属于此 DataTable
    • ¥15 安卓adb backup备份应用数据失败