Skip to content

sizgiyaev/jenkins-docker

Repository files navigation

Automated Jenkins Master Docker


Features:

  1. Jenkins plugin list can be supplied at a time of container building
  2. Authetication method can be defined at a time of container building
    a. Local (The admin username and password must be supplied)
    b. LDAP (all LDAP users will have admin rights to the newly deployed Jenkins)
    c. LDAP restricted (LDAP username or group must be provided to restrict admin rights only to them for the newly deployed Jenkins)

Usage:

Run container using install plugins from file option

docker run -d -p 8080:8080 -p 50000:50000 \
-v $(pwd)/plugins.txt:/tmp/plugins.txt sizgiyaev/jenkins --plugins-file /tmp/plugins.txt

Run container using install plugins from environment variables (It's possible to mix options)

docker run -d -p 8080:8080 -p 50000:50000 -e JENKINS_PLUGIN_a=<plugin_b_id> \
                           -e JENKINS_PLUGIN_b=<plugin_a_id> \
                           sizgiyaev/jenkins --plugins-from-environment

Local authentication. The specified user will be the first admin on the system.

docker run -d -p 8080:8080 -p 50000:50000 \
-e 'JENKINS_AUTHENTICATION=local' \
-e 'JENKINS_LOCAL_USER=<username>' \
-e 'JENKINS_LOCAL_PASS=<password>' sizgiyaev/jenkins

LDAP authentication - Unrestricted Mode. All LDAP autheticated users will have admin privileges on the system.

docker run -it -p 8080:8080 -p 50000:50000 \
-e 'JENKINS_AUTHENTICATION=ldap' \
-e 'JENKINS_LDAP_SERVER=<ldap://{HOSTNAME}:{PORT}>' \
-e 'JENKINS_LDAP_ROOTDN=DC=domain,DC=com' \
-e 'JENKINS_LDAP_BIND_USER=<Manager user DN>' \
-e 'JENKINS_LDAP_BIND_PASS=<Manager user password>' \
-e 'JENKINS_SEARCH_FILTER=samaccountname={0}' \
sizgiyaev/jenkins

LDAP authentication - Restricted Mode. Only specified LDAP users or members of specified LDAP group will have admin privileges on the system.

docker run -it -p 8080:8080 -p 50000:50000 \
-e 'JENKINS_AUTHENTICATION=ldap_restricted' \
-e 'JENKINS_LDAP_SERVER=<ldap://{HOSTNAME}:{PORT}>' \
-e 'JENKINS_LDAP_ROOTDN=DC=domain,DC=com' \
-e 'JENKINS_LDAP_BIND_USER=<Manager user DN>' \
-e 'JENKINS_LDAP_BIND_PASS=<Manager user password>' \
-e 'JENKINS_SEARCH_FILTER=samaccountname={0}' \
-e 'JENKINS_LDAP_ADMINS=user1,group1,user2,group2' \
sizgiyaev/jenkins

Parameters:

JENKINS_AUTHENTICATION - (Required) Authentication type. Can be one of local, ldap or ldap_restricted.

Local authentication mode:

JENKINS_LOCAL_USER= - (Required) Local admin username.
JENKINS_LOCAL_PASS - (Required) Local admin user's password.

LDAP authentication mode:

JENKINS_LDAP_SERVER - (Required) LDAP server URL in format ldaps?://{hostname}:{port}
JENKINS_LDAP_ROOTDN - (Required) Base DN, eg. DC=domain,DC=com
JENKINS_LDAP_BIND_USER - (Required) DN for LDAP manager user.
JENKINS_LDAP_BIND_PASS - (Required) Password of LDAP manager user.
JENKINS_LDAP_RESTRICTED - (Required) Defines the LDAP mode. Can be one of yes or no.
JENKINS_SEARCH_BASE - (Optional) Where to search users in LDAP tree, eg. ou=people
JENKINS_SEARCH_FILTER - (Optional) Which LDAP attribute to use to identify username. Default is uid={0}. For Microsoft AD samaccountname={0} may be used.
JENKINS_DISPLAY_NAME_ATTRIBUTE - (Optional) Display Name LDAP attribute. Default is displayname.
JENKINS_EMAIL_ADDRESS_ATTRIBUTE - (Optional) Email Address LDAP attribute. Default is mail.
JENKINS_GROUP_SEARCH - (Optional) Where to search groups in LDAP tree, eg. ou=groups
JENKINS_LDAP_ADMINS - (Required for restricted mode) - Comma separated list of users and/or groups to assign admin role.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published