Install Docker
-
Install Docker:
-
Mac:
-
Windows:
- https://store.docker.com/editions/community/docker-ce-desktop-windows (Requires Microsoft Windows 10 Professional or Enterprise 64-bit)
- https://download.docker.com/win/stable/Docker%20for%20Windows%20Installer.exe
-
安裝後執行後系統列會出現鯨魚符號,開啟後會出現下圖,點擊關閉,開啟 Terminal
可能會用到指令:
docker ps -q
docker ps -a
docker image list
docker run
docker pull
docker exec -it (id) bash
安裝 MySQL:
* docker pull mysql
* docker run -itd --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=1234 mysql
* docker ps
* docker exec -it <CONTAINER ID> bash
// 進入 container 中執行 bash
* mysql -u root -p
如果需要額外安裝 phpmyadmin
* docker pull phpmyadmin/phpmyadmin
* docker run --name myadmin -d --link mysql:db -p 127.0.0.1:8080:80 phpmyadmin/phpmyadmin
* http://localhost:8080