I have the following step in my pipeline:
- step:deployment: Clientscript:- apt-get stuff- ssh -N -L 4430:some_ip:4430 some_host &- sleep 10 # Give SSH tunnel some time to establish- curl -k https://localhost:4430 # Works- pipe: docker://tomerh2001/gitlab-merge-request-pipe:latestvariables:GITLAB_TOKEN: $GITLAB_TOKEN
I am trying to understand which IP/Host I need to specify for the pipe to access the tunnel from the main flow. I tried `host.docker.internal` but that doesn't work.
For context, I have locally replicated the docker run command that bitbucket creates to run the pipe, and it works locally with host.docker.internal when I run the docker image of the custom pipe
I guess that in the pipeline context, the host.docker.internal resolves the host of the docker service itself? And since the SSH tunnel was created inside the pipeline (I.e. a docker container), would I need to somehow find the IP of that container in order to access the tunnel?
My goal is to access the tunnel from within the pipe. Any help will be greatly appreciated!
Hi Tomer,
What error do you get when you run the pipe?
Have you tried using http://host.docker.internal:4430 (instead of https)?
I'm not sure about the tunneling, but if I start an HTTP server on the build container on port 8000, the curl command works from within the pipe container if I use curl http://host.docker.internal:8000
I was also curious, why are you using an SSH tunnel instead of the GitLab URL in the GITLAB_URL variable?
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.