Skip to content

Instantly share code, notes, and snippets.

@lnoering
Last active June 3, 2022 14:23
Show Gist options
  • Save lnoering/ac019048a3981523c5b1ef92f9118f43 to your computer and use it in GitHub Desktop.
Save lnoering/ac019048a3981523c5b1ef92f9118f43 to your computer and use it in GitHub Desktop.
[Magento 2] - Docker from cloud running at local

Docker from magento cloud at local.

1 - Need start the project.

bash <project-root>/vendor/magento/magento-cloud-docker/bin/init-docker.sh

https://devdocs.magento.com/cloud/docker/docker-development.html

2 - Build the compose

./vendor/bin/ece-docker build:compose --mode="developer"

https://devdocs.magento.com/cloud/docker/docker-launch.html

3 - Run the dokcer-compose

docker-compose up -d

4 - Check the services access it's right here: (Magento root folder)

vi .magento.env.yaml

More commands here: https://devdocs.magento.com/cloud/docker/docker-quick-reference.html

To access the php container use:

docker-compose run --rm deploy bash

TO add ionCube

https://github.com/magento/magento-cloud-docker/pull/72/files/404d885f3561ba79f78e486cb356c0d70cff755f#diff-6aa425a379e86b6b86a6b4c9a483bf77083bb477d9a01d808187957e77940737

Need change the dockerfile (fpm and cli) to include this lines.

RUN cd /tmp
&& curl -O http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
&& tar zxvf ioncube_loaders_lin_x86-64.tar.gz
&& export PHP_CONFD=$(php-config --configure-options|sed 's/.\with-config-file-scan-dir=(\S).*/\1/g')
&& export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")
&& export PHP_EXT_DIR=$(php-config --extension-dir)
&& cp "ioncube/ioncube_loader_lin_${PHP_VERSION}.so" "${PHP_EXT_DIR}/ioncube.so"
&& rm -rf ./ioncube
&& rm ioncube_loaders_lin_x86-64.tar.gz

On command RUN docker-php-ext-enable add

ioncube

  • Change the docker-compose to use that images.
    # image: 'magento/magento-cloud-docker-php:7.4-fpm-1.2.2'
    build:
      context: ./vendor/magento/magento-cloud-docker/images/php/7.4-fpm/
    # image: 'magento/magento-cloud-docker-php:7.4-cli-1.2.2'
    build:
      context: ./vendor/magento/magento-cloud-docker/images/php/7.4-cli/
  • You will need build the compose again.

@credits /texboy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment