Docker on Mac: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 14: | Line 14: | ||
</source> | </source> | ||
http://localhost now works | http://localhost now works | ||
== mysql == | |||
<source lang='bash'> | |||
docker run --name mysql57 --detach --env=MYSQL_ROOT_PASSWORD=root -p 3307:3306 mysql/mysql-server:5.7.14 | |||
</source> | |||
Revision as of 13:48, 27 August 2017
Unfortunately Docker usage on mac is limited see:
This means the approach:
docker run -d --name webserver nginx
docker inspect webserver | grep 'IPAddress":'
"IPAddress": "172.17.0.2",
"IPAddress": "172.17.0.2",
and then trying to connect via http://172.17.0.2 on port 80 won't work The workaround is to publish the port locally:
docker run -d -p 80:80 --name webserver nginx
http://localhost now works
mysql
docker run --name mysql57 --detach --env=MYSQL_ROOT_PASSWORD=root -p 3307:3306 mysql/mysql-server:5.7.14