0

I'm currently running jenkins from a container on my azure container instances, but I'm having difficulty with connecting. I specified port 80 when I run the CLI command:

az container create -g MyResourceGroup --name MyName --image MyImage --ports 80

Is there something I missed or another way I could configure it from the portal so that I can connect and setup jenkins? Any help would be appreciated.

Charles Xu
  • 29,862
  • 2
  • 22
  • 39
avenmia
  • 2,015
  • 4
  • 25
  • 49

2 Answers2

1

The possible reason is that your container instance is not accessible outside because you do not expose it to the Internet. If you want to expose it to the Internet, the command should be like this:

az container create -g MyResourceGroup --name MyName --image MyImage --ports 80 --ip-address Public

For more details, see parameter --ip-address in az container create.

Or you can connect into the container instance through the CLI command az container exec -g MyResourceGroup --name mynginx --container-name nginx --exec-command "/bin/bash" or exec the command in the portal.

In addition, it seems you run Jenkins in the container instance. I would not recommend you do this. Because the Container Instance is a light-weight service, if you run a server in it, then it won't be actually what it should be anymore. The VM is an appropriate host for the Jenkins server. See Jenkins in VM.

Charles Xu
  • 29,862
  • 2
  • 22
  • 39
  • Thanks! I'll try this. I also saw I can run Jenkins as a resource in Azure so I may just try that as well, but I wasn't sure the cost versus creating and destroying a container when I wanted to mess around with it. – avenmia Nov 21 '19 at 15:25
  • 1
    @avenmia The ACI and the VM both cost according to the usage of the resources such as vCPU, memory and etc. But VM is more stable and controllable, so it's more appropriate than ACI. By the way, if the answer solves your problem, you can mark it. – Charles Xu Nov 22 '19 at 01:35
0

Did you specify the DNS name with the parameter --dns-name-label

Shiraz Bhaiji
  • 64,065
  • 34
  • 143
  • 252