<p>Instead of creating a dockerfile yourself you could also pull a docker image, e.g. <a href="https://hub.docker.com/r/alexcheng/magento2/" rel="nofollow noreferrer">alexcheng/magento2</a>.</p>

CC BY-SA 3.0
2017-12-03T14:51:33.953Z
2017-12-03T14:51:33.953Z
030
<p>I'm going to talk about general process here, rather than addressing Magneto specifically, so that it's useful to more people and situations.</p>

<blockquote>
  <p>How do I automate this Magento2 installation process from dockerfile. Like setting up database and the other installation process.</p>
</blockquote>

<p>Run through the wizard process once. Track down the files it generates, which isn't straightforward and may require a few tries. Pull those configuration files into your app configuration, and try a fresh container that just uses those.</p>

<p>That is, reproduce what the installation wizard is doing in your own configuration tool. This sounds difficult, but often the wizard is complex because it needs to address many situations, and you are fine hard-coding many things for your specific situation.</p>

<p>As a final note, since we're talking about Docker, presumably the database resides on another machine. Therefore, you only need to set it up once, and that process will be part of <em>its</em> provisioning, not this container's.</p>

CC BY-SA 3.0
2017-12-20T17:07:04.543Z
2017-12-20T17:07:04.543Z
Xiong Chiamiov
<p>This is what I have accomplished up to now. Written a docker file where I have done the following and for now I have not used the docker compose.</p>

<ol>
<li>Used alpine as base Os</li>
<li>setup nginx</li>
<li>setup php-fpm</li>
<li>Installed magento2 file </li>
</ol>

<p>So my docker build is ready and the container is ready and can see the setup page when opening it on the browser.</p>

<p><a href="https://i.sstatic.net/MFLHY.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/MFLHY.png" alt="enter image description here"></a></p>

<p><strong>My problem</strong>
How do I automate  this Magento2 installation process from <strong>dockerfile</strong>. Like setting up database and the other installation process.</p>

CC BY-SA 3.0
2017-11-24T17:16:55.250Z
Doesn't the official documentation [Install the Magento software using the command line](http://devdocs.magento.com/guides/v2.0/install-gde/install/cli/install-cli.html) answer the question ?
Tensibai
CC BY-SA 3.0
2017-11-24T17:22:07.310Z
may be that is the process to follow let me go through
Tara Prasad Gurung
<docker><dockerfile>
How to automate the magento2 installation process too via docker
Tara Prasad Gurung
# How to automate the magento2 installation process too via docker

(Asked by: username_0 on 2017-11-24)

This is what I have accomplished up to now. Written a docker file where I have done the following and for now I have not used the docker compose.

1. Used alpine as base Os
2. setup nginx
3. setup php-fpm
4. Installed magento2 file

So my docker build is ready and the container is ready and can see the setup page when opening it on the browser.

[![enter image description here](https://i.sstatic.net/MFLHY.png)](https://i.sstatic.net/MFLHY.png)

**My problem**
How do I automate this Magento2 installation process from **dockerfile**. Like setting up database and the other installation process.

**Tags:** docker, dockerfile

> **Comments:**
> **username_1**: Doesn't the official documentation [Install the Magento software using the command line](http://devdocs.magento.com/guides/v2.0/install-gde/install/cli/install-cli.html) answer the question ?  
> **username_0**: may be that is the process to follow let me go through  

---

## 2 answers

### Answer by username_2 on 2017-12-03. Score: 1

Instead of creating a dockerfile yourself you could also pull a docker image, e.g. [alexcheng/magento2](https://hub.docker.com/r/alexcheng/magento2/).


---

### Answer by username_3 on 2017-12-20. Score: 1

I'm going to talk about general process here, rather than addressing Magneto specifically, so that it's useful to more people and situations.

> How do I automate this Magento2 installation process from dockerfile. Like setting up database and the other installation process.

Run through the wizard process once. Track down the files it generates, which isn't straightforward and may require a few tries. Pull those configuration files into your app configuration, and try a fresh container that just uses those.

That is, reproduce what the installation wizard is doing in your own configuration tool. This sounds difficult, but often the wizard is complex because it needs to address many situations, and you are fine hard-coding many things for your specific situation.

As a final note, since we're talking about Docker, presumably the database resides on another machine. Therefore, you only need to set it up once, and that process will be part of *its* provisioning, not this container's.


---

