How do i run a image with --device permissions in gitlab-ci

Viewed 177

Im trying to run a test stage in gitlab ci that need access to host usb devices. Im running the gitlab-runner in a docker container(started the container with the device settings) the runner is configured as a docker executor.

When I docker exec -it into the gitlab-runner container I can access the usb devices but when running the gitlab-ci job with the image from the container registry the image doesnt seem to have access to the usb devices. What could be the issue?

1 Answers

Looks like adding devices in the config.toml file for the gitlab-runner solved it. No need for any special settings for the gitlab-runner container.

[runners.docker]   
  devices = [""]
Related