Answer the question
In order to leave comments, you need to log in
How to access a docker container from Jenkins?
Good afternoon!
There was a question to which I did not find a clear answer. Please tell me how to solve the following. task.
Environment:
Running on the server: a docker container with a dev version of the application and a configured environment & a docker container with jenkins.
Required:
When pushing to the dev branch, jenkins starts the build (it's clear how to do it), then one of the build steps is testing, which can only be done in the configured environment (in our case, this is a separate container that spins next to the jenkins' container a). At this stage, you need to access an external container from jenkins, run tests and collect test results for further reporting within jenkins.
Question:
How can you correctly organize access to an external container from a jenkins container (given that they are running on the same server)?
Answer the question
In order to leave comments, you need to log in
To do this, it is enough that the jenkins container has a docker client, and there is access to the docker host daemon. Install docker in container and forward unix docker socket from host to jenkins.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question