Gitlab webhook to Docker Container running Jenkins hosted on home network - docker

I have an Ubuntu server running 2 docker containers one is running Jenkins and the other one is running Sonarqube. My school has a private gitlab server from this server I want to create an webhook to my Jenkins to trigger a build but the following error is coming up.. And I Don't know what is going on...
enter image description here
Both port forwarded via router using the following ports:
jenkins xx.xx.xx.xxx:8080
sonarqube xx.xx.xx.xxx:8090
Getting the following error when testing the webhook using the by jenkins provided url to trigger: http://xx.xx.xx.xxx:8080/project/some_project
enter image description here
Does it have to do with docker?

Related

Differences between Jenkins docker-agent and docker-inbound-agent

I couldn't get the differences or better say the benefits of using docker-agent or docker-inbound-agent for Jenkins as part of Cloud Nodes.
currently, I am using the routine Docker configuration for Configuration Cloud to use docker as agent to build application.
Jenkins Controller running on Host#1
another host for running docker agents!
base on GitHub readme:
docker-inbound-agent is using TCP or WebSockets to establish inbound connection to the Jenkins master.
docker-agent
docker-inbound-agent
According the docker-agent readme on github :
This image is used as the basis for the Docker Inbound Agent image. In
that image, the container is launched externally and attaches to
Jenkins.
This image may instead be used to launch an agent using the Launch
method of Launch agent via execution of command on the master.
docker-agent is used to launch an agent with a command on the master :
This launch the agent on the master.
docker-inbound-agent got the docker-agent image as basis (see on a Dockerfile) :
ARG version=latest-alpine-jdk11
FROM jenkins/agent:$version
This image was before named jnlp-slave (see this link) which got the same goal. This setup an agent which connect to the jenkins using the TCP protocol.
You also have a third agent, the docker-ssh-agent which is used to be connected to the master with SSH.

I've a problem with jenkins docker integration

I've a gitlab container and i've a jenkins container locally. I can configured the CI, but but i can't solve the cd. I would like to when i push the code to repo the jenkins build my Blazor Server App solution in docker container locally.
Can you help me ?
Setup a Gitlab webhook like so: https://docs.gitlab.com/ee/user/project/integrations/webhooks.html
set up a Jenkins pipeline with the necessary information inside a jenkinsfile like so: https://www.jenkins.io/doc/book/pipeline/jenkinsfile/
The Gitlab webhook should send a request to the local jenkins container to execute the pipeline. You will need to make sure the appropriate ports are opened and linked between the container and the host computer.

Deploying Jenkins Server on Google Cloud Run

Deploying Jenkins Server on Google Cloud Run
Cloud run service URL is long-awaited and the Jenkins server is not getting ready to configure
Please wait while Jenkins is getting ready - waiting long
but not being starting or getting ready
Jenkins server is successfully running in my machine via Kubernetes pod
I want to run Jenkins server on serverless solutions, one of the best serverless is cloud run.
I have deployed jenkins/jenkins:lts container on cloud run and make it public IP to access cloud run service.
everything is working fine.
When I access public URL to configure Jenkins server it showing "Please wait while Jenkins is getting ready"
It is taking too much time and not getting ready. I have tried many times to delete service and check it locally, fine, and again deploy to cloud run, many times and it not getting ready, now it's stuck. Is there any way out to run Jenkins on the Google cloud run.
Docker Image jenkins/jenkins:lts
Tag Image gcr.io/projectName/jenkinsci:latest
successfully deploy on Google cloud run
but Jenkins server is not getting ready

Making docker container a build executor for jenkins

I have a ec2 instance running as my jenkins master. I would like to run a container in that instance that will be used as another build executor so I can tun a few builds simultaneously.
Im having pronblems connecting these.
In the docker hub jenkins docs it says under the relevant section:
You can run builds on the master out of the box.
But if you want to attach build slave servers through JNLP (Java Web
Start): make sure you map the port: -p 50000:50000 - which will be
used when you connect a slave agent.
If you are only using SSH slaves, then you do NOT need to put that
port mapping.
but when I try to add a node in the jenkins config, it asks remote root directory (probably should be /var/jenkins ? ) and a launch method.
I don't quite understand what I should give it as its launch method to make this work and I don't understand where the port number comes into play.
What you need is Jenkins Docker plugin (link below) and follow the instructions listed here
https://wiki.jenkins.io/display/JENKINS/Docker+Plugin
I followed those instructions and was able to setup dynamic slaves in Jenkins which are dynamically provisioned.

Jenkins in Docker-Machine

I created a Docker machine using,
https://docs.docker.com/v17.12/machine/get-started/#use-machine-to-run-docker-containers
I have also created a jenkins image on that docker-machine and added the docker-build-step plugin. When I use the Test Connection I get the following message:
How do I connect my jenkins image to the docker daemon?
The protocol to connect the API is not tcp is http is a REST API URL what Jenkins expect. Try with:
http://172.21.245.40:2376

Resources