version: '3'
не работает.
, но
version: '2'
работает
Это мой тест
32 image: daocloud.io/mysql:5.7.21
33 ports:
34 - "3306:3306"
35 volumes:
36 - ./my.cnf:/etc/mysql/my.cnf
37 environment:
38 - MYSQL_ROOT_PASSWORD=dangerous
39 mysql3307:
40 image: daocloud.io/mysql:5.6
41 ports:
42 - "3307:3306"
43 environment:
44 - MYSQL_ROOT_PASSWORD=dangerous
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a5317caa2a56 daocloud.io/mysql:5.7.21 "docker-entrypoint.s…" 3 minutes ago Up 3 minutes 0.0.0.0:3306->3306/tcp service_mysql_1
9c5e3f2750f9 daocloud.io/mysql:5.6 "docker-entrypoint.s…" 3 minutes ago Up 3 minutes 0.0.0.0:3307->3306/tcp service_mysql3307_1
В 9c5e3f2750f9 я запускаюэто
mysql -u root -pdangerous -h mysql
Работает, но когда я меняю версию на '3'.
Warning: Using a password on the command line interface can be insecure.
ERROR 2005 (HY000): Unknown MySQL server host 'msyql' (0)