Unable to access Jenkins container outside of host network - jenkins

I am stuck in a step. I am using an ubuntu vm which is in Azure cloud through terminal; don't have UI access. There I have installed docker and pulled the jenkins image. I have mapped this container from my host machine by running following command - docker run -p 8080:8080 jenkins to access this jenkins from my MAC using Ubuntu IP address:8080, however I am getting the This site cannot be reached. So do I am following or missed any steps to mapped the container outside of docker host machine? Please help!

Related

Docker compose disabling my login to Azure Linux VM

I am trying to deploy the airflow docker compose to my azure linux vm.
when i run (apache airflow) docker compose on azure VM.
docker-compose up
It tries to create a network and kicks me out of SSH. Thereafter , I am not able to login to the VM.
Can someone plz help?

Is there any configuration to run docker inside a jenkins container?

I am trying to build an image with docker and then upload it to the docker hub, after passing the quality tests I receive the following error: docker: not found, how can I communicate my docker service (localhost) with the container of jenkins.
Important: I have docker desktop installed locally and I have installed jenkins in a local container also in windows 10 pro.
Error: https://imgur.com/q1SrKGe
Pipeline: https://imgur.com/nQWL1HR
You have 2 options to do this:
Install Docker inside your Jenkins Container and also add a bind mount for the Docker socket from your host. Otherwise your Docker Daemon inside your Container wont work. On Linux this socket is /var/run/docker.sock, so the bind mount would look like -v /var/run/docker.sock:/var/run/docker.sock.
Use a different slave agent for the Building Image Stage where you have docker installed. For e.g. you could use Docker-in-Docker (https://hub.docker.com/_/docker) as a Slave Agent for Jenkins (connected via ssh) and run your docker build inside this slave agent.

Unable to connect to local Docker host from Jenkins

I have docker installed on my Windows 10 OS on my laptop. Also I have pulled the jenkins image and created a container out of it (Image: docker pull jenkins/jenkins:latest).
My jenkins is up and running on localhost:8080. Now I have installed Docker plugin within the Jenkins and then I Add a new Cloud to run my build against docker.
However, while giving the docker host URI as "tcp://localhost:2375" it is giving me Connection Refused
Debug Steps:
I have already made by docker server listening on port 2375
I tried adding the host entry in C:\ProgramFiles\Docker\config\daemon.json
I tried adding an env variable DOCKER_HOST to "tcp://localhost:2375
But none of the above worked.
However, when I launch jenkins on my local windows machine instead of launching it from docker, it is able to resolve the Docker host URI.

Unable to connect Docker Windows Container using VNC server

I have a problem connecting a windows container I wish to use for running automation scripts.
Host - Primary Operating System which is running HyperV and docker
(Access to UI)
Target - container hosted on Host using docker (No access to UI)
Following are the details of the environment am working on:
Container image : mcr.microsoft.com/windows/servercore
Installed components include: Maven / Java / VNCServer.
Docker container is running on docker using HyperV on the same machine I wish to connect this container to.
Host Operating System is windows 10 pro.
I installed all softwares in the Target by copying them first and performing a silent installation.
I tried the following solutions but none have been possibly working out.
Started container with command : docker run -itd -p 5920:5920 --name containername imagename
Started container with command : docker start containername
Got access to cmd of Target node : docker exec -it containername cmd
Ran tasklist to ensure : vnserver was running
On Host supplied the IP address of the Target along with port numbers 5920 which results in errors stating timed out connection.
I need to be able to see the UI of the Target system and be able to
control it on the host.
Tried Commands from Teamviewer -id -p but it itself launches the UI which is not available on the Target system.
Is there a way I can get this working?
Please let me know if you need any additional information.

No connectivity between EC2 instance and Docker container

I have an EC2 instance (Ubuntu 16.04 ami-ba602bc2) deployed. I've installed docker on it and downloaded a Docker container that runs JasperReports in Tomcat. I've tested this Docker container on my laptop and it works correctly. I downloaded and started the Docker container on the EC2 instance with
docker run -itd -p 8080:8080 dwschulze/jasperreports.server.v7.1.ubuntu.16.04:latest
the same command I use locally to run on my laptop. docker ps shows the container running. I've opened port 8080 in the AWS security group.
I've also connected to the Docker container and verified that the tomcat instance is running.
I can't connect to the reports server from the internet. I've also tried telnet localhost 8080 from the EC2 instance and it times out.
Everything I've read says that I should be able to run a Docker container on an EC2 instance, but it can't even connect locally.
Any ideas?
Thanks.
My problem was that I was running in a t2.small which is too small to even run Tomcat (let alone Jasper Reports) reliably. I switched to a t2.xlarge and problem solved.

Resources