I am using GitLab.com and default shared runner and below is my .gitlab-ci.yml file:
image: maven:3.3.9-jdk-8
build:
script:
- mvn -X clean install
Here I am making use of docker image "maven:3.3.9-jdk-8". Do I have any possible way so that i can ssh into default runner with docker image and do any further configuration for the same image. This is required for me in the future if I want to install other packages like nodejs, mongodb or any other.
I can achieve this by setting up custom Runner but is there any way I can accomplish the same from default runner with docker image. Thanks
As far as I understand, you can't because for one job you can use only one runner of a given type. In your case,the job is executed by the docker runner.
If you want to use docker and to perform some shell tasks, i would recommend using the shell executor.
Instead of specifying the maven image, you can use docker to run the maven command(docker must be installed).
docker -i --rm -v "$(pwd)":/usr/src/myproject -w /usr/src/myproject maven:latest mvn -X clean install
Since the shell executor runs scripts locally on the host where the runner runs, you can run other scripts without ssh.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With