Does Docker need to be installed ona Windows server that's hosting a GitLab CICD runner?

79 views Asked by At

I'm using an on-premise hosted GitLab andt have a CI/CD pipeline which builds a .NET 6 application, executes unit tests and deploys the binaries to a ZIP file for later deployment. I want to add code-coverage and code security scanning to the pipeline but to use those features provided in GitLab, it seems I need to use Docker?

So how does that work?

Does the code-coverage and security pipeline script exist in a Docker container that needs to be downloaded from GitLab and configured, or do I just need to install Docker on the Windows server and let GitLab do the rest?

I've read the docs provided by GitLab but I'm a bit confused about it all.

1

There are 1 answers

1
sytech On BEST ANSWER

Yes, you need a GitLab runner configured with the docker executor to take advantage of most of GitLab's builtin templates for things like security scanning. These jobs rely on docker images provided by GitLab.

In order to run a GitLab runner with the docker executor, you need Docker installed on the system.

This is noted in the documentation. For example, for dependency scanning, the documentation notes the following prerequisite:

  • On GitLab self-managed you need GitLab Runner with the docker or kubernetes executor. On GitLab.com this is enabled by default on the shared runners. The analyzer images provided are for the Linux/amd64 architecture.

But not all features require this. For example, code coverage reports only require that your CI job produce a coverage file in a supported format and the executor does not matter in this case.

myjob:
  script:
    - make coverage  # produces the cobertura coverage file
  artifacts:
    reports:
      coverage_report:
        coverage_format: cobertura
        path: coverage.cobertura.xml