software download docker pull mysql:5.6 docker pull php:5.6-fpm docker pull nginx Create a Startup php-fpm docker run --name php5603 -v ~/nginx/www:/www -d php:5.6-fpm | Php which you want to install pdo_mysql, mysql, mysqli extension Create a Startup nginx docker run --name nginx5603 -p 8088:80 -d \ -V ~ / nginx / www: / Sr / share / nginx / html: ro \ -v ~/nginx/conf/conf.d:/etc/nginx/conf.d:ro \ --link php5603:php \ nginx Creating start mysql docker run --name mysql04 -p 3306:3306 -e MYSQL_ROOT_PASSWORD=xxxx -d mysql:5.6 | Default is mysql8, its default encoding modified into utfmb4, we need to modify the configuration file | Into the container docker exec -it php / bin / bash To the directory cd / usr / local / bin Installing an expansion ./docker-php-ext-install pdo_mysql Installing an expansion ./docker-php-ext-install mysql ./docker-php-ext-install mysqli Restart container docker php restart ctrl + d exit