Dockerfile linksDocker container built with CentOS 7, NGINX and PHP with compatible version and modules for Magento
Sandbox build for Magento 2.x (2-dev) comes with composer, nodejs, grunt.
These are the Docker Hub autobuild images located here.
$ docker pull locnh/docker-magento
$ docker run --name magento -v /path/to/magento:/var/www/html -p 80:80 -d locnh/docker-magento
That's it !
Just add the environment variable with -e WEB_SRV=apache or -e WEB_SRV=httpd
Example:
$ docker run --name magento -e WEB_SRV=httpd -v /path/to/magento:/var/www/html -p 80:80 -d locnh/docker-magento
uid (and/or gid) of apache inside containerTo change the apache uid, use -e UID=<your uid> (you can use this).
To change the apache gid, use -e GID=<your gid> (use at your own risk).
Example:
$ docker run --name magento -e UID=501 -v /path/to/magento:/var/www/html -p 80:80 -d locnh/docker-magento
Just add the environment variable with -e XDEBUG_RHOST=<REMOTE_HOST>.
Example your IDE is running at IP 10.0.75.1:
$ docker run --name magento -e XDEBUG_RHOST=172.17.0.1 -v /path/to/magento:/var/www/html -p 80:80 -d locnh/docker-magento
Beside Webroot /var/www/html, you can use option -v to mount more volumes to the container such as services logs:
/var/log/nginx/var/log/httpd/var/www/php-fpmIf you don't specify tag, default tag is latest. In case you need the build for specified version of magento, use the version as tag. For example, if you need a container to run:
Magento 2.x:
$ docker run --name magento -v /path/to/magento:/var/www/html -p 80:80 -d locnh/docker-magento:2
Magento 1.x:
$ docker run --name magento -v /path/to/magento:/var/www/html -p 80:80 -d locnh/docker-magento:1
Content type
Image
Digest
Size
212 MB
Last updated
almost 6 years ago
docker pull locnh/docker-magento