Docker: Magento2 Installation

Get Magento2:

apt update
apt install git
git clone https://github.com/magento/magento2

Install composer

curl -sS https://getcomposer.org/installer | php -- --filename=composer --install-dir=/usr/local/bin
apt install libzip-dev # for zip ext.
apt install libpng-dev libjpeg-dev libfreetype-dev # for gd ext.
apt install libicu-dev # for intl ext.
apt install libxml2-dev # for soap ext.
apt install libxslt1-dev # for xsl ext.
docker-php-ext-configure gd --with-jpeg=/usr/lib --with-freetype=/usr/lib # enable JPEG and freetype support in GD
docker-php-ext-install bcmath sockets zip gd intl pdo_mysql soap xsl # install extensions
composer install

export PATH=$PWD/bin:$PATH

Open app/etc/di.xml and go to line 1860.

<item name="MySQL-8" xsi:type="string">^8\.0\.</item>
<item name="MySQL-8" xsi:type="string">^8\.3\.</item>

Disable external search modules:

magento module:disable Magento_OpenSearch Magento_Elasticsearch Magento_Elasticsearch7

magento setup:install\
	--db-host=192.168.107.6\
    --db-name=magento1\
    --db-user=root\
    --db-password=secret

cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini