RUN \ echo "deb http://mirrors.163.com/debian/ jessie main non-free contrib\ndeb http://mirrors.163.com/debian/ jessie-updates main non-free contrib\ndeb http://mirrors.163.com/debian/ jessie-back ports main non-free contrib\ndeb-src http://mirrors.163.com/debian/ jessie main non-free contrib\ndeb-src http://mirrors.163.com/debian/ jessie-updates main non-free contrib\ndeb-src http://mirrors.163.com/ debian/ jessie-backports main non-free contrib\ndeb http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib\ndeb-src http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib" | tee /etc/apt/sources.list && \ apt-get update && apt-get install -y \ libfreetype6-dev \ libjpeg62-turbo-dev \ libmcrypt-dev \ libpng12-dev \ && docker-php-ext-install -j$(nproc) gd mcrypt
RUN chmod -R 777 /var/www/html/
CMD ["apache2-foreground"]
此时便可以构建Docker镜像了。构建完毕。
1 2 3 4 5 6
See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ----------------------------------------------------------------------
Build complete. Don't forget to run 'make test'.
接着运行docker镜像
1
sudo docker run -d --name showdoc -p 4999:80 showdoc
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 7b236aaa5fc3 showdoc "docker-php-entrypoi 8 seconds ago Up 7 seconds 0.0.0.0:4999->80/tcp showdoc