Docker-compose mysql does not seem to recognize environment variable MYSQL_RANDOM_ROOT_PASSWORD

Viewed 8000

I am trying to setup mysql to run in a docker container. I have a simple docker compose file :-

db:
  image: mysql:latest
  ports:
    - "3306:3306"
  environment:
    - MYSQL_RANDOM_ROOT_PASSWORD=yes

when i run the docker-compose file, I get the following warning in docker logs instead of the random generated password.

[Warning] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.

Is there something I am missing?

1 Answers
Related