Openshift privileged container access services from openshift namespace

9/29/2018

I'm trying to run my custom Jenkins on Openshift. I'm trying to run dockerized pipelines using privileged containers and scc to be able to run docker using my Jenkins. So far, I managed to run the job and it is creating a new Docker container successfully. But, since my new docker is created by Jenkins it doesn't have access to Nexus service on my project. How can I fix this? I was thinking the solution should be for the Jenkins to run docker in the same namespace as my Jenkins.

-- AmirMV
docker
jenkins-pipeline
kubernetes
openshift

1 Answer

9/29/2018

I'm assuming that you want to run your container in Kubernetes.

On your Deployment I would advise using either a ConfigMap or if you want to keep in encrypted in the cluster you can use a Secret to store your Nexus credentials.

Then you can mount your ConfigMap or Secret under ~/.ivy2/.credentials for example.

-- Rico
Source: StackOverflow