Skip to content

Commit

Permalink
Add DNS-server issue explanation (#1917)
Browse files Browse the repository at this point in the history
A lot of people seem to be searching for answers when this happens, and the obvious answer is not easily found. On my QNAP nas I had to specify this to allow the container to resolve adresses on the internet succesfully,
  • Loading branch information
jcjveraa committed Aug 19, 2024
1 parent dfd1dc5 commit 842e084
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ docker run -p 8080:8080 -p 50000:50000 --restart=on-failure jenkins/jenkins:lts-
```

NOTE: read the section [_Connecting agents_](#connecting-agents) below for the role of the `50000` port mapping.
NOTE: read the section [_DNS Configuration_](#dns-configuration) in case you see the message "This Jenkins instance appears to be offline."

This will store the workspace in `/var/jenkins_home`.
All Jenkins data lives in there - including plugins and configuration.
Expand Down Expand Up @@ -114,6 +115,15 @@ If you want to install Jenkins behind a reverse proxy with a prefix, example: my
- [Apache](https://www.jenkins.io/doc/book/system-administration/reverse-proxy-configuration-apache/)
- [Nginx](https://www.jenkins.io/doc/book/system-administration/reverse-proxy-configuration-nginx/)

## DNS configuration

If the message "This Jenkins instance appears to be offline." appears on first startup, and the container logs show lines such as `java.net.UnknownHostException: updates.jenkins.io`, your container may be having issues with resolving DNS names.

To potentially solve the issue, start the container specifying a dns server (for example Cloudflare's 1.1.1.1 or Google's 8.8.8.8, or any other DNS server):
```
docker run -p 8080:8080 -p 50000:50000 --restart=on-failure --dns 1.1.1.1 --dns 8.8.8.8 jenkins/jenkins:lts-jdk17
```

## Passing Jenkins launcher parameters

Arguments you pass to docker running the Jenkins image are passed to jenkins launcher, so for example you can run:
Expand Down Expand Up @@ -312,6 +322,17 @@ This will pull the necessary images from Docker Hub if they are not already pres

You can then access the Jenkins web interface on `http://localhost:8080` on your host system to configure and manage your Jenkins instance (where `localhost` points to the published port by your Docker Engine).

NOTE: read the section [_DNS Configuration_](#dns-configuration) in case you see the message "This Jenkins instance appears to be offline." In that case add the dns configuration to the yaml:
```yaml
services:
jenkins:
# ... other config
dns:
- 1.1.1.1
- 8.8.8.8
# ... other config
```

### Updating plugins file

The [plugin-installation-manager-tool](https://github.com/jenkinsci/plugin-installation-manager-tool) supports updating the plugin file for you.
Expand Down

0 comments on commit 842e084

Please sign in to comment.