Hello Gitlab community !
I try to launch my multi-layer project through docker-compose and run some end-to-end tests on it with cypress.
My .gitlab-ci.yml file :
test:
stage: test
image: docker
variables:
DOCKER_DRIVER: overlay
services:
- docker:dind
before_script:
- apk add --no-cache python python-dev py-pip libffi-dev openssl-dev gcc libc-dev make
- pip install docker-compose
- apk add --no-cache --update nodejs npm
- npm install
script:
- docker-compose up -d
- cypress run
- docker-compose stop
But it seems that when gitlab-runner run this job, it creates a separate container to start my docker-compose containers and run my tests in another container. So when my tests try to reach the http://localhost URL, it fails.
When I execute a docker ps on my Gitlab host , I’ve got the following :
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
07b867953ebc 61b2e482e9de "docker-entrypoint.s…" 8 minutes ago Up 8 minutes runner-vTpeNzvF-project-8-concurrent-0-build-4
1923a5d9c4ae a6e51fd179fb "dockerd-entrypoint.…" 8 minutes ago Up 8 minutes 2375-2376/tcp runner-vTpeNzvF-project-8-concurrent-0-docker-0
It’s probably a problem in my runner configuration but I can’t find a way to make it works.
Thanks in advance !