Rajeev kumar
Rajeev kumar

Reputation: 41

unable to stop a docker container running on my mac

I am unable to stop a docker container running on my mac. after stoping this container it always pops up.

Here is the logs

(base) ➜  ~ docker ps
CONTAINER ID        IMAGE                                  COMMAND                  CREATED             STATUS              PORTS               NAMES
e4258d657c8d        quay.io/prometheus/prometheus:latest   "/bin/prometheus --c…"   4 minutes ago       Up 4 minutes        9090/tcp            monitoring_prometheus.1.wrps0j1w9m4jz82fec9d71xiu
(base) ➜  ~
(base) ➜  ~
(base) ➜  ~ docker stop e4258d657c8d
e4258d657c8d
(base) ➜  ~ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
(base) ➜  ~ docker ps
CONTAINER ID        IMAGE                                  COMMAND                  CREATED             STATUS              PORTS               NAMES
4bfb8f9ea862        quay.io/prometheus/prometheus:latest   "/bin/prometheus --c…"   9 seconds ago       Up 2 seconds        9090/tcp            monitoring_prometheus.1.rw1tpoi92052rfgsgxt4mm2ll
(base) ➜

Upvotes: 0

Views: 84

Answers (1)

BMitch
BMitch

Reputation: 263549

You've deployed the container using swarm mode and it will automatically recover from any deviation from the target state. To change the target state, delete the service (or entire stack):

docker service rm monitoring_prometheus

docker stack rm monitoring

Upvotes: 1

Related Questions