Closed sh-cau closed 6 months ago
We can add support for this, but my question is how do you then, plan to run this via the actual gitlab runnner ?
Maybe you can give the following a try?
#.gitlab-ci.yml
job:
image: bash
script:
- ifconfig eth0 hw ether "AA:BB:CC:DD:EE:FF"
- ip a show eth0
Addtional info: Until https://gitlab.com/gitlab-org/gitlab-runner/-/issues/27863 is implemented, you might want to go with the hacky workaround as recommended here https://gitlab.com/gitlab-org/gitlab-runner/-/issues/2344#note_95853536
The actual gitlab runner is registered using gitlab-runner register --docker-mac-address AA:BB:CC:DD:EE:FF ...
, which writes the mac address in the config.toml
of the gitlab runner much like described in your second reference. Unfortunately, gitlab-runner exec
ignores this configuration entirely (but it doesn't when its being called by GitLab).
You solution works, however, this requires me to adjust the .gitlab-ci.yaml
everytime I want to test locally and this, in fact, is the reason I quit using gitlab-runner exec
because with that you can't pass CI-specific environment variables, say, CI_JOB_TOKEN
or CI_PIPELINE_SOURCE
, which also leads to me having to rename these variables for the testing time.
Is your feature request related to a problem? Please describe. I want to pass additional options, that is to say, especially setting the MAC address, of the docker container like I would with, e.g.,
Describe the solution you'd like I would like to achieve the above equivalent like so
Describe alternatives you've considered I tried manipulating the
--container-executable
, i.e.,and
to no avail.
Additional context I need this feature since the docker container runs a MATLAB instance, the license of which is linked to a fixed MAC address.
Thank you!