Jenkins Docker Installation Errors

make sure you using docker pull jenkins/jenkins only if you are using docker pull Jenkins then may face more issues

While installing Jenkins with docker you might face below errors, and these are the errors I have faced.

yaml.scanner.ScannerError:

yaml.scanner.ScannerError: while scanning for the next token found character ' ' that cannot start any token.

You are using the tabs inside the docker-compse.yml file; remove the tabs and use spaces instead

mapping values are not allowed here:

ERROR: yaml.scanner.ScannerError: mapping values are not allowed here in "./docker-compose.yml", line 6, column 10

You might have used double quotes for a value that not supposed to have double-quotes. Also, you might have provided value to a place where no value is required.

Version in "./docker-compose.yml" is invalid.

Version in "./docker-compose.yml" is invalid. You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
the version you are using in the docker-compose.yml is not compatible with docker-compose.

jenkins say it is offline when I installed using docker:
WARNING: Upgrading Jenkins. Failed to update the default Update Site 'default'. Plugin upgrades may fail.
java.net.UnknownHostException: updates.jenkins-ci.org
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

offline-jenkins-docker-vm

Firewall creating the issue, so execute the below commands, I am using centOS 8; please use commands according to your OS.

#allow traffic on port 80/443 on centos firewall using this command:

firewall-cmd --zone=public --add-masquerade --permanent
firewall-cmd --zone=public --add-port=80/tcp
firewall-cmd --zone=public --add-port=443/tcp
firewall-cmd --reload

#then reboot the OS.
About Author :

I am Pavankumar, Having 8.5 years of experience currently working in Video/Live Analytics project.

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions