GitlabCi使用docker和mysql服务缓慢构build

我正在使用gitlab-ci-multirunner 9.3.0和GitLab Community Edition 9.3.5

当我在我的本地虚拟环境中运行我的php-unittesting时,总testing(30)只需要大概:

Time: 5 minutes, Memory: 96.00MB 

在我的gitlab主机上运行相同的testing,它总共需要

 Time: 41.68 minutes, Memory: 97.75MB 

testing需要mysql,并在每个testing上做一个数据库创build和夹具加载。

我的DockerFile:

 FROM tetraweb/php:5.6 # Install additional packages RUN apt-get clean && apt-get -qq update RUN apt-get -qq upgrade -y RUN apt-get install -qq -y apt-utils RUN apt-get install -qq -y mysql-client libmagickwand-dev libgeoip-dev -y --no-install-recommends RUN pecl install imagick apcu-4.0.11 geoip RUN docker-php-ext-enable exif gd gettext intl mcrypt mysql mysqli opcache pdo_mysql zip memcache apcu imagick geoi 

我的gitlab-ci.yml:

 variables: TIMEZONE: Europe/Berlin MYSQL_DATABASE: test MYSQL_ROOT_PASSWORD: test-root MYSQL_USER: test MYSQL_PASSWORD: asecurething SYMFONY_ENV: "test" stages: - test - deploy test: image: test-image-php:5.6 services: - mariadb:latest stage: test only: - branches except: - master script: - export COMPOSER_CACHE_DIR=x/cache/composer - SYMFONY_ENV=test composer install --no-progress --no-interaction - chmod +x bin/console - php vendor/phpunit/phpunit/phpunit --coverage-text --colors=never 

我真的认为这是造成巨大差异的MySQL服务故障。 什么是提高我的phpunittesting的最佳方式?