http://www.tp-shop.cn/download/ 下載php
解壓至主機文件夾:/var/www/tpshophtml
docker run -d -p 8886:80 --name tpshop --link mysql:mysql -v /var/www/tpshop:/var/www/html --privileged=true --restart=always php:7.0-apachemysql
進入容器sql
docker exec -it tpshop /bin/bashdocker
安裝缺乏的擴展:freetype gd mysqli pdo pdo_mysqlapache
apt-get update -y瀏覽器
apt-get install -y libfreetype6-dev libmcrypt-dev libjpeg-dev libpng-dev
docker-php-ext-configure gd --enable-gd-native-ttf --with-freetype-dir=/usr/include/freetype2 --with-png-dir=/usr/include --with-jpeg-dir=/usr/includebashdocker-php-ext-install gd mysqli pdo pdo_mysqlspa
退出容器rest
exit
設置文件夾目錄權限
chmod -R 777 /var/www/tpshop
重啓容器
docker restart tpshop
http://localhost:8886