yin5th@yin5th:~/code/docker/phpmyadmin$ tree . └── docker-compose.yml 0 directories, 1 file
文件結構: 只有一個docker-compose.yml
docker-compose.yml:
yin5th@yin5th:~/code/docker/phpmyadmin$ cat docker-compose.yml
version: '3'
services:
phpmyadmin:
image: "phpmyadmin/phpmyadmin"
container_name: "phpmyadmin"
ports:
- "9090:80"
environment:
- PMA_ARBITRARY=1
db:
image: "mysql:5.7"
container_name: "phpmyadmin_db"
docker-compose.yml同級目錄下執行:docker-compose up -d
訪問localhost:9090即可
注:
1.如果只是用於本地連接,可以不設置:PMA_ARBITRARY=1
2.沒有做數據庫內容的保存,需要的話添加:volumes相關
3.修改了yml文件后,執行docker-compose down 然后 docker-compose up -d即可
