0

I have a container from (https://hub.docker.com/r/library/mysql/) in (docker toolbox) started with with this yml using command , will k

"docker-compose -f stack.yml up"

# Use root/example as user/password credentials
version: '3.1'

services:

  db:
    image: mysql-test
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: example

  adminer:
    image: adminer
    restart: always
    ports:
        - 8080:8080

even i delete the container, it will recreate (mysql_adminer.1.4cxxxxxxxxxxxxx5iyt) it and start it, everyone how to stop that?

what solutions i have taken:
1. command: docker update --restart=no containerId => not work
2. changed in .yml restart: "no" => not work
3. docker-compose -f stack.yml down => output:Removing network mysqltest_default, no effect
4. restart virtual-box image => it stills start when the docker start 5. delete every thing but it stills exist
https://s31.postimg.cc/5feduonfv/adminer.jpg

how can i remove that container except format the drive?

solutions: $ docker service ls ID NAME MODE REPLICAS IMAGE PORTS orbx4v7ipg7s mysql_adminer replicated 1/1 adminer:latest *:8080->8080/tcp wm515zc39ltf mysql_db replicated 0/1 mysql-test:latest

$ docker service rm mysql_adminer mysql_adminer

$ docker service rm mysql_db mysql_db

hkguile
  • 4,235
  • 17
  • 68
  • 139

1 Answers1

1

Remove restart: always OR change always to no from docker-compose yml file.

restart

no is the default restart policy, and it does not restart a container under any circumstance. When always is specified, the container always restarts. The on-failure policy restarts a container if the exit code indicates an on-failure error.

restart: "no"

restart: always

restart: on-failure

restart: unless-stopped

Ref. https://docs.docker.com/compose/compose-file/

Haresh Chhelana
  • 24,720
  • 5
  • 57
  • 67