Docker command: from---
ENV---setting environment variables
ENV app_dir/apppadd and copy can copy files into the container1. Difference add can write network link address Add support decompression function Run command: entrypoint: Only last entry effective Docker build-T register_ip/Centos7. Helping Docker help run-P and-P Difference:-P arbitrarily fetch a port number mapping # Important effect The current mirror does not take effect # when it is re-set as mirroring Onbuild Add./app//Enter interactive mode:Docker exec-it container name/bin/Bash//keep our database down.VOLume ShellSet-e # when it's wrong, don't go on===============================Docker Run-d-p3306:3306-v Host_dir (host): Container_dir (Container) DockerFile. Dockerignore Write non-committed files here Docker-d-p the: the-E Database_name=MySQL-e is the difference between configuration parameters entrypoint and cmd only the last one takes effect, running a Docker container like running a program CMD will overwrite the instructions can be done via Docker run-it--entrypoint=/bin/bash
##maintainer Carson,c.j.zeong <[email protected]>#docker-version 1.6.2##dockerizing php-fpm:dockerfile for building php-fpm images#From csphere/centos:7.1Maintainer Carson, C.j.zeong <[email protected]>#Set environment variableENV App_dir/Apprun Yum-Y swap--Remove FAKESYSTEMD--install systemd systemd-libs &&Yum-y install Nginx php-cli php-MySQLPhp-pear php-ldap php-mbstring php-soap php-dom php-gd php-xmlrpc php-fpm php-mcrypt &&\ Yum Clean alladd nginx_nginx. Conf/etc/nginx/nginx.Confadd Nginx_default. conf/etc/nginx/conf.d/default.Confadd php_www. conf/etc/php-fpm.d/www.confrun sed-I ' s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/'/etc/php.Inirunmkdir-p/app &&Echo"<?php phpinfo ();?>" > ${app_dir}/info.Phpexpose80 443ADD Supervisor_nginx. Conf/etc/supervisor.conf.d/nginx.Confadd supervisor_php-FPM.CONF/ETC/SUPERVISOR.CONF.D/PHP-FPM.Confonbuild ADD. /Apponbuild RUNChown-R Nginx:nginx/app
DockerFile parameter explanation