Jenkins setup from Docker Kitematic

Objective:
The objective of this article to understand how to setup Jenkins container from the Docker Kitematic dashboard. This will also give you an overview of how can we create, start, stop and delete any containers from Docker Kitematic.

Details:
Jenkins is one of the tools which is most commonly using across the IT industry as part of the project CI/CD process. CI/CD stands for Continuous Integration / Continuous Deployment. The main agenda of this post to make you understand how easy of installing the Jenkins container by using Docker Kitematic.

As we already explained in the previous post, Docker Kitematic is a Graphical tool to manage different docker containers that exist in Docker. So as part of this post, we will not use any Command Line Interface(CLI).

Prior to the continuation of this article, make sure you have installed Kitematic in Docker. If you have not installed, follow the steps which are explained in Docker Kitematic installation in Windows 10.

Create a Container:
Step 1: The above diagram represents the official Jenkins Docker image in the Docker Kitematic dashboard along with other images like ghost, Redis, Solr, elasticsearch, etc. Click on the CREATE button to download the Jenkins docker image.
If we need to pull the Jenkins docker image from DockerHub, we need to use the below command, but as part of Kitematic, we are not executing any of the commands explicitly.

docker pull jenkins

Start Container:
Step 2: You will be shown the download progress page, let’s wait until the download completes. And it automatically starts the Container as on when the download completes. You can observe the Jenkins container startup logs in below,

Running from: /usr/share/jenkins/jenkins.war
webroot: EnvVars.masterEnvVars.get("JENKINS_HOME")
 Oct 08, 2019 6:00:56 PM Main deleteWinstoneTempContents
WARNING: Failed to delete the temporary Winstone file /tmp/winstone/jenkins.war
 Oct 08, 2019 6:00:57 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Logging initialized @3721ms
Oct 08, 2019 6:00:57 PM winstone.Logger logInternal
INFO: Beginning extraction from war file
 Oct 08, 2019 6:01:03 PM org.eclipse.jetty.util.log.JavaUtilLog warn
WARNING: Empty contextPath
 Oct 08, 2019 6:01:03 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: jetty-9.2.z-SNAPSHOT
Oct 08, 2019 6:01:07 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
Jenkins home directory: /var/jenkins_home found at: EnvVars.masterEnvVars.get("JENKINS_HOME")
Oct 08, 2019 6:01:10 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started w.@47404bea{/,file:/var/jenkins_home/war/,AVAILABLE}{/var/jenkins_home/war}
Oct 08, 2019 6:01:11 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started ServerConnector@1c80e49b{HTTP/1.1}{0.0.0.0:8080}
Oct 08, 2019 6:01:11 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started @17405ms
Oct 08, 2019 6:01:11 PM winstone.Logger logInternal
INFO: Winstone Servlet Engine v2.0 running: controlPort=disabled
Oct 08, 2019 6:01:14 PM jenkins.InitReactorRunner$1 onAttained
INFO: Started initialization
Oct 08, 2019 6:01:14 PM jenkins.InitReactorRunner$1 onAttained
INFO: Listed all plugins
Oct 08, 2019 6:01:22 PM jenkins.InitReactorRunner$1 onAttained
INFO: Prepared all plugins
Oct 08, 2019 6:01:22 PM jenkins.InitReactorRunner$1 onAttained
INFO: Started all plugins
Oct 08, 2019 6:01:22 PM jenkins.InitReactorRunner$1 onAttained
INFO: Augmented all extensions
Oct 08, 2019 6:01:28 PM jenkins.InitReactorRunner$1 onAttained
INFO: Loaded all jobs
Oct 08, 2019 6:01:29 PM hudson.model.AsyncPeriodicWork$1 run
INFO: Started Download metadata
Oct 08, 2019 6:01:29 PM jenkins.util.groovy.GroovyHookScript execute
INFO: Executing /var/jenkins_home/init.groovy.d/tcp-slave-agent-port.groovy
Oct 08, 2019 6:01:31 PM jenkins.InitReactorRunner$1 onAttained
INFO: Completed initialization
Oct 08, 2019 6:01:32 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@4b266244: display name [Root WebApplicationContext]; startup date [Tue Oct 08 18:01:32 UTC 2019]; root of context hierarchy
Oct 08, 2019 6:01:32 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@4b266244]: org.springframework.beans.factory.support.DefaultListableBeanFactory@6362a49e
Oct 08, 2019 6:01:32 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@6362a49e: defining beans [authenticationManager]; root of factory hierarchy
Oct 08, 2019 6:01:34 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@6d93e090: display name [Root WebApplicationContext]; startup date [Tue Oct 08 18:01:34 UTC 2019]; root of context hierarchy
Oct 08, 2019 6:01:34 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@6d93e090]: org.springframework.beans.factory.support.DefaultListableBeanFactory@7a6e32a5
Oct 08, 2019 6:01:34 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@7a6e32a5: defining beans [filter,legacy]; root of factory hierarchy
Oct 08, 2019 6:01:35 PM jenkins.install.SetupWizard init
INFO: 

*************************************************************
*************************************************************
*************************************************************

Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:

6ad6a1bd484844a690881ad01a1b8878

This may also be found at: /var/jenkins_home/secrets/initialAdminPassword

*************************************************************
*************************************************************
*************************************************************

--> setting agent port for jnlp
--> setting agent port for jnlp... done
Oct 08, 2019 6:01:50 PM hudson.model.UpdateSite updateData
INFO: Obtained the latest update center data file for UpdateSource default
Oct 08, 2019 6:01:51 PM hudson.model.DownloadService$Downloadable load
INFO: Obtained the updated data file for hudson.tasks.Maven.MavenInstaller
Oct 08, 2019 6:01:56 PM hudson.model.DownloadService$Downloadable load
INFO: Obtained the updated data file for hudson.tools.JDKInstaller
Oct 08, 2019 6:01:56 PM hudson.model.AsyncPeriodicWork$1 run
INFO: Finished Download metadata. 27,079 ms
Oct 08, 2019 6:01:58 PM hudson.model.UpdateSite updateData
INFO: Obtained the latest update center data file for UpdateSource default
Oct 08, 2019 6:01:58 PM hudson.WebAppMain$3 run
INFO: Jenkins is fully up and running

As per the above logs, we can understand, downloading Jenkins metadata is finished and Jenkins is fully up and running. We can also observe that from the highlighted lines, Jenkins is created the admin user to access and do the initial setup of Jenkins with the encrypted password.

Below is the normal command which we will use to run the docker container. In this case, we are using the Jenkins image to run as a container in Docker.

docker run -it -p 8080:8080 Jenkins

How can I access Jenkins?
By default, Docker Jenkins will use 8080(Not exposed) port so make sure there are no other processes are using the same port. We can’t directly access the Jenkins with the port of 8080 when we are running from Docker Kitematic. This 8080 port is internally mapped to some other host:port which is exposed to the outside world. We can find that information under the Settings ==> Hostname/Port as shown in the below image,

As on when we hit the localhost:32779 from any of the browsers, we can see the below screen.

What is the default Jenkins admin password?
There are 2 ways to find the password.
1. You can find it from the Jenkins Container startup logs as shown in the above.
2. Click on /var/jenkins_home under the Volumes to extract the war file content. You can also find the password from the below path after volume(war) extraction completes.

C:\Users\USER\Documents\Kitematic\jenkins\var\jenkins_home\secrets\initialAdminPassword 

Jenkins Customization page:
As on when we successfully authenticated, we will be shown a page called Jenkins Customization page. Look at the below snapshot,

As on when I choose the Install Suggested plugins option from the above screen, Jenkins started installing the plugins. Please look at the plugin installation progress as shown in the below image,

If in case you get a message of saying some of the plugins are failed to install, do you want to retry or continue? better retry once or twice. If still you will be shown the same message, just ignore and choose the link of Continue.
Create First Admin User:

Click on Continue as admin link from the above screen you will be shown the below screen.

Click on Start using Jenkins to see the Jenkins home page.

Now your Jenkins setup is done successfully. You can create new jobs to configure CI/CD process for your project.

How to Stop, Restart running containers in Kitematic?
Stopping or restarting the running docker container is an easy process from Docker Kitematic. As shown in the below image, please click on Stop/Restart button accordingly to process the same.

How to delete the Docker container from Kitematic?
As shown in the below image, you can find the DELETE CONTAINER button under the SETTINGS tab to delete any of the containers from Docker Kitematic.

I hope this will be clear. Thanks for VISITING. Happy Learning…. 🙂

Advertisements
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s