How to restart the container when reloading dockers (--restart = true does not work)?

I am using docker version 1.1.0, run by systemd using the command line /usr/bin/docker -d, and tried:

  • run container
  • stop the docker service
  • restart the docker service (either using systemd or manually by specifying --restart=trueon the command line)
  • see if my container is still working

As I understand the docs, my container must be restarted. But this is not so. Its open port does not respond, but docker psdoes not show it.

docker ps -a shows my container with an empty status:

CONTAINER ID        IMAGE                   COMMAND                CREATED             STATUS                         PORTS                    NAMES
cb0d05b4e0d9        mildred/p2pweb:latest   node server-cli.js -   7 minutes ago                                      0.0.0.0:8888->8888/tcp   jovial_ritchie      
...

And when I try docker restart cb0d05b4e0d9, I get an error message:

Error response from daemon: Cannot restart container cb0d05b4e0d9: Unit docker-cb0d05b4e0d9be2aadd4276497e80f4ae56d96f8e2ab98ccdb26ef510e21d2cc.scope already exists.
2014/07/16 13:18:35 Error: failed to restart one or more containers

, , docker run ..., , , docker . , , (, ).

+4
1

, , , , , - --restart=always, Docker, docker stop, Docker , Docker .

0

Source: https://habr.com/ru/post/1548630/


All Articles