I developp a php symfony project and I use gitlab. I want to build the unit test on gitlab, for that I use gitlab-ci.yml file :
image: php:5.6
# Select what we should cache
cache:
paths:
- vendor/
before_script:
# Install git, the php image doesn't have installed
- apt-get update -yqq
- apt-get install git -yqq
# Install mysql driver
- docker-php-ext-install pdo_mysql
# Install composer
- curl -sS https://getcomposer.org/installer | php
# Install all project dependencies
- php composer.phar install
services:
- mysql
variables:
# Configure mysql service (https://hub.docker.com/_/mysql/)
MYSQL_DATABASE: hello_world_test
MYSQL_ROOT_PASSWORD: mysql
# We test PHP5.5 (the default) with MySQL
test:mysql:
script:
- phpunit --configuration phpunit_mysql.xml --coverage-text -c app/
It currently doesn't work because my hostname isn't resolved on the docker container.
I found the solution here : How can you make the docker container use the host machine's /etc/hosts file?
My question is : Where do I write the --net=host option ?
Thanks.