Use stable or -stable suffixed docker tags (are built from vX.Y git tags), others may be unstable.
Please see the docker hub repo page mageops/magento-run-tests.
Container will by default exit after 1h to prevent dangling container in CI environments,
you can adjust this behavior by changing setting different CONTAINER_TIMEOUT environment variable.
Setting CONTAINER_TIMEOUT to no will disable that behavior completely.
The master branch uses Maria DB 10.2, Elasticsearch 6 and PHP 7.2 which are the latest versions supported by Magento.
Other versions will be avaialble on appropriately named branches / docker tags.
-latest - built from branch tip-stable - built from tags named vX.Ylatest - master branch tipstable - latest tag named vX.Y| Version | Docker tag | PHP | DB | Elasticsearch |
|---|---|---|---|---|
| php71-es5-mariadb102 | php71-es5-mariadb102-stable | 7.1.X | MariaDB 10.2 | 5.X |
| php71-es6-mariadb102 | php71-es6-mariadb102-stable | 7.1.X | MariaDB 10.2 | 6.X |
| php72-es6-mariadb102 | php72-es6-mariadb102-stable | 7.2.X | MariaDB 10.2 | 6.X |
| php73-es6-mariadb102 | php73-es6-mariadb102-stable | 7.3.X | MariaDB 10.2 | 6.X |
| php71-es7-mariadb103 | php71-es7-mariadb103-stable | 7.1.X | MariaDB 10.3 | 7.X |
| php72-es7-mariadb103 | php72-es7-mariadb103-stable | 7.2.X | MariaDB 10.3 | 7.X |
| php73-es7-mariadb104 | php73-es7-mariadb104-stable | 7.3.X | MariaDB 10.4 | 7.X |
| php74-es7-mariadb104 | php74-es7-mariadb104-stable | 7.4.X | MariaDB 10.4 | 7.X |
Note: The exec mount opt on /tmp is needed for elasticsearch because it maps mem to temp files.
The image is big and there's not really a way around it since it has a lot of software and is based on CentOS (which we use for local dev / production deployments, so we want to keep everything else close).
docker run \
--rm \
--detach \
--name mgs-test \
--tmpfs /tmp:rw,exec,mode=1777 \
--tmpfs /var/lib/mysql:rw,mode=777 \
--tmpfs /var/lib/elasticsearch:rw,mode=777 \
--tmpfs /var/www/html/generated:rw,mode=777 \
--tmpfs /var/www/html/var:rw,mode=777 \
--tmpfs /var/www/html/dev/tests/integration/tmp:rw,mode=777 \
--volume "$(pwd):/var/www/html" \
"mageops/magento-run-tests:php72-es6-mariadb102-stable"
while [[ "$(docker inspect --format='{{json .State.Health.Status}}' mgs-test)" == '"starting"' ]] ; do sleep 1s && echo "Waiting for start"; done
docker exec \
--tty \
mgs-test \
/usr/bin/mgs-run-tests ci creativestyle "$(id -u)" "$(id -g)"
Alternatively if the internal UID/GID switch doesn't work for you for some reason you can try switching the docker UID/GID:
docker exec \
--tty \
--user "$(id -u):$(id -g)" \
mgs-test \
/usr/bin/mgs-run-tests ci creativestyle
During the testing you can get into the bash shell to poke around:
docker exec -it mgs-test /bin/bash
As an alternative you could run everything at once as the tests will wait for healthcheck to become green before proceeding:
docker run \
--tty \
--tmpfs /tmp:rw,exec,mode=1777 \
--tmpfs /var/lib/mysql:rw,mode=777 \
--tmpfs /var/lib/elasticsearch:rw,mode=777 \
--tmpfs /var/www/html/generated:rw,mode=777 \
--tmpfs /var/www/html/var:rw,mode=777 \
--tmpfs /var/www/html/dev/tests/integration/tmp:rw,mode=777 \
--volume "$(pwd):/var/www/html" \
"mageops/magento-run-tests:php72-es6-mariadb102-stable" \
"/usr/bin/elasticsearch-server" \
"/usr/bin/mysql-server" \
"/usr/bin/mgs-run-tests ci creativestyle $(id -u) $(id -g)"
docker run \
--tty \
--interactive \
--tmpfs /tmp:rw,exec,mode=1777 \
--tmpfs /var/lib/mysql:rw,mode=777 \
--tmpfs /var/lib/elasticsearch:rw,mode=777 \
--tmpfs /var/www/html/generated:rw,mode=777 \
--tmpfs /var/www/html/var:rw,mode=777 \
--tmpfs /var/www/html/dev/tests/integration/tmp:rw,mode=777 \
--volume "$(pwd):/var/www/html" \
"mageops/magento-run-tests:php72-es6-mariadb102-stable" \
"/bin/bash"
You can start the services while inside by doing:
/usr/sbin/start-elasticsearch &
/usr/sbin/start-mysql &
Content type
Image
Digest
Size
584.4 MB
Last updated
over 5 years ago
docker pull mageops/magento-run-tests