# docker run -ti --rm --link wordpress-mysql:mysql busybox ping "mysql"
PING mysql (172.17.0.2): 56 data bytes
64 bytes from 172.17.0.2: seq=0 ttl=64 time=3.477 ms
64 bytes from 172.17.0.2: seq=1 ttl=64 time=0.061 ms
# docker run --link wordpress-mysql:mysql --volumes-from wordpressData -p 80:80 -e WORDPRESS_DB_PASSWORD='$MYSQL_ROOT_PASSWORD' -ti --rm wordpress /bin/sh
Warning: mysqli::mysqli(): (HY000/1045): Access denied for user 'root'@'172.17.0.17' (using password: YES) in - on line 5
MySQL Connection Error: (1045) Access denied for user 'root'@'172.17.0.17' (using password: YES)
# docker run --link wordpress-mysql:mysql --volumes-from wordpressData -p 80:80 -e WORDPRESS_DB_PASSWORD='$MYSQL_ROOT_PASSWORD' -ti --rm wordpress /bin/sh
Warning: mysqli::mysqli(): (HY000/1045): Access denied for user 'root'@'172.17.0.18' (using password: YES) in - on line 5
MySQL Connection Error: (1045) Access denied for user 'root'@'172.17.0.18' (using password: YES)
I didn't observe the same behavior of other images.
# docker run -ti --rm --link wordpress-mysql:mysql busybox ping -c 2 "mysql" && date
PING mysql (172.17.0.2): 56 data bytes
64 bytes from 172.17.0.2: seq=0 ttl=64 time=0.774 ms
64 bytes from 172.17.0.2: seq=1 ttl=64 time=0.062 ms
--- mysql ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.062/0.418/0.774 ms
Fri Jan 16 06:17:43 UTC 2015
# docker run -ti --rm --link wordpress-mysql:mysql busybox ping -c 2 "mysql" && date
PING mysql (172.17.0.2): 56 data bytes
64 bytes from 172.17.0.2: seq=0 ttl=64 time=0.648 ms
64 bytes from 172.17.0.2: seq=1 ttl=64 time=0.081 ms
--- mysql ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.081/0.364/0.648 ms
Fri Jan 16 06:17:46 UTC 2015