0

my docker-compose.yml included MySQL 5.6 and phpMyAdmin:

version: '3.3'
services:
  db:
    image: mysql:5.7
    command: --default-authentication-plugin=mysql_native_password
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: 'xxxx'
    ports:
      - '3306:3306'
    expose:
      - '3306'
    volumes:
      - xxx-db:/var/lib/mysql

  phpmyadmin:
    image: phpmyadmin/phpmyadmin:latest
    environment:
      PMA_PORT: 3306
      PMA_HOST: db
      PMA_USER: xxxx
      PMA_PASSWORD: xxxx
      MYSQL_PASSWORD: xxxx
    ports:
    - "8081:80"
    restart: always
    depends_on: 
    - db

volumes:
  xxx-db:

I have then executed

 sudo systemctl enable docker

to have it started on computer startup.

It was workung great! But I needed to upgrade MySQL to 5.7 so I have changed the 5.6 to 5.7 in the config file.

Suddenly, I have noticed that the previous configuration is still run when I restart the machine.

CONTAINER ID        IMAGE                   COMMAND                  CREATED             STATUS              PORTS                    NAMES
ed87e31b8a67        phpmyadmin/phpmyadmin   "/docker-entrypoint.…"   6 months ago        Up 35 minutes       0.0.0.0:8081->80/tcp     docker_phpmyadmin_1
6f03e022dfcd        mysql:5.6               "docker-entrypoint.s…"   6 months ago        Up 35 minutes       0.0.0.0:3306->3306/tcp   docker_db_1

When I manually kill both docker containers and execute docker-compose up -d

I get the correct versions:

CONTAINER ID        IMAGE                          COMMAND                  CREATED             STATUS              PORTS                               NAMES
d3006820b836        phpmyadmin/phpmyadmin:latest   "/docker-entrypoint.…"   4 hours ago         Up 3 seconds        0.0.0.0:8081->80/tcp                var_phpmyadmin_1
278cb25ece95        mysql:5.7                      "docker-entrypoint.s…"   4 hours ago         Up 3 seconds        0.0.0.0:3306->3306/tcp, 33060/tcp   var_db_1

But when I restart the machine the old configuration comes back. Of course, I have tried turning it off and on again :)

 sudo systemctl disable docker
 sudo systemctl enable docker

How do I "purge" the old configuration?

Thank you in advance!

Pepe
  • 123
  • 3

1 Answers1

1

How did you kill the containers? Did you remove them with docker rm <container-id>? You can also try docker container prune after stopping these unwanted containers.

I think if you have only stopped/killed them, then that's the reason that they come back with the older version.

dywan666
  • 160
  • 8