0

I want to run my pipeline on kubernetes executor runner instead of docker executor runner for GitLab.

The challenge is that I am using docker-compose along with docker-in-docker currently, so I have been suggested to use Kaniko as replacement.

However as per my understanding Kaniko is for building images, and in my case I am using pre-built images.

And as per this ticket, Kaniko doesn't support docker compose like functionality: https://github.com/GoogleContainerTools/kaniko/issues/309

Hence I am uncertain how can I solve this issue.

It would be a great help if someone can help with this.

Please find the docker-compose.yml below:

version: "3"
services:
  chrome:
    image: selenium/node-chrome:110.0
    depends_on:
      - selenium-hub
    environment:
      - SE_EVENT_BUS_HOST=selenium-hub
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443

  edge:
    image: selenium/node-edge:110.0
    shm_size: 2gb
    depends_on:
      - selenium-hub
    environment:
      - SE_EVENT_BUS_HOST=selenium-hub
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443

  firefox:
    image: selenium/node-firefox:110.0
    shm_size: 2gb
    depends_on:
      - selenium-hub
    environment:
      - SE_EVENT_BUS_HOST=selenium-hub
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443

  selenium-hub:
    image: selenium/hub:latest
    container_name: selenium-hub
    depends_on:
      - java-maven
    ports:
      - "4442:4442"
      - "4443:4443"
      - "4444:4444"

  java-maven:
    image: maven:3.8-openjdk-11

And here's my gitlab-ci.yml:

variables:
  MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository"

stages:
  - test
  
services:
  - docker:20.10.16-dind

test:
  stage: test
  image: docker:latest
  script:
    - docker-compose up -d
    - sleep 10
    - docker run --rm --network host -v "$(pwd)":/app -w /app maven:3.8-openjdk-11 mvn ${MAVEN_OPTS} test -Dcucumber.filter.tags=${FEATURE_TAG} 
  artifacts:
    when: always
    name: "report"
    paths:
      - test-output/*
    expire_in: 1 h
SRM21
  • 453
  • 5
  • 14

0 Answers0