Public Repository

Last pushed: 2 years ago
Short Description
Magento 2 docker image
Full Description

Supported tags and respective Dockerfile links

Magento 2

Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting edge, feature-rich eCommerce solution that gets results.

The installation instructions that used to be here are now published on our GitHub site. Use the information on this page to get started or go directly to the guide.

How to use this image

Platform

First you need to create a new Magento 2 project:

composer create-project -n magento/product-community-edition magento2 1.0.0-beta1 && cd magento2

Then you add a docker-compose.yml file with your custom values:

web:
  image: chadrien/magento2:5.6-apache
  links:
    - db
  ports:
    - 80
  volumes:
    - ".:/var/www"
db:
  image: mysql
  environment:
    MYSQL_ROOT_PASSWORD: rootpassword
    MYSQL_DATABASE: magento2
    MYSQL_USER: magento2
    MYSQL_PASSWORD: mySQLpassword

Now you can start your containers:

docker-compose up -d
docker-compose port web 80

Then open your browser to http://127.0.0.1:PORT to start Magento2 setup wizard.

You are now ready to develop your Magento 2 modules in app/code and your changes will be visible in Docker.

Full

If you just want to try Magento 2 easily, just adapt this docker commands with your custom values:

docker run --name magento2_db -d -e MYSQL_ROOT_PASSWORD="rootpassword" -e MYSQL_DATABASE="magento2" -e MYSQL_USER="magento2" -e MYSQL_PASSWORD="yourpassword" mysql
docker run --name magento2_web -d -p 80 --link=magento2_db chadrien/magento2:5.6-apache-full-1.0.0-beta
docker port magento2_web

Then you should be able to install on http://127.0.0.1:PORT

Docker Pull Command
Owner
chadrien

Comments (2)
urshree
a year ago

While setting up magento, i was unable to connect to Mysql Container using localhost or 127.0.0.1.
If anyone is facing the same issue, use the below method.
At terminal:
docker inspect containerId

note down the ip listed for your container under "Network Settings". Use the same IP for the Database server

mkz71
2 years ago

After I install and configure the magento2 container, I open magento2 and magento2/admin page. They seem fine but
after I docker restart the container, I can only see text on magento2 and magento2/admin page. I bash to container shell and try to restart apache2 with this command, service apache2 restart

I got this msg, Restarting web server: apache2Terminated

and then it just kills my container.