E-mail : support@tech2now.in

How to install Jenkins in Docker

Pull the docker images by given below command.

PS C:\Users> docker pull jenkins/jenkins:lts-jdk11
lts-jdk11: Pulling from jenkins/jenkins
93c2d578e421: Pull complete
82eb791f1e55: Pull complete
5d6561b893fc: Pull complete
f452b29de875: Pull complete

8e143e896634: Pull complete
70d24d22f6e7: Pull complete
99cdc8682f2f: Pull complete
f05b84f61353: Pull complete
9ee59605167b: Pull complete
b848888a376b: Pull complete
eabb8e9fa475: Pull complete
bee7451ff081: Pull complete
7f720ce1df9a: Pull complete
Digest: sha256:2da4de0918e5133c04e255b835c12d7790735183bc21032a1f08b3e398f48840
Status: Downloaded newer image for jenkins/jenkins:lts-jdk11
docker.io/jenkins/jenkins:lts-jdk11

Run the Jenkins service by given below command.

PS C:\Users> docker run -p 8080:8080 -p 50000:50000 –restart=on-failure jenkins/jenkin
s:lts-jdk11
Running from: /usr/share/jenkins/jenkins.war
webroot: /var/jenkins_home/war
2023-07-18 05:44:33.432+0000 [id=1] INFO winstone.Logger#logInternal: Beginning extractio
n from war file
2023-07-18 05:44:36.026+0000 [id=1] WARNING o.e.j.s.handler.ContextHandler#setContextPath: E
mpty contextPath
2023-07-18 05:44:36.237+0000 [id=1] INFO org.eclipse.jetty.server.Server#doStart: jetty-1
0.0.13; built: 2022-12-07T20:13:20.134Z; git: 1c2636ea05c0ca8de1ffd6ca7f3a98ac084c766d; jvm 11.0
.19+7
2023-07-18 05:44:37.009+0000 [id=1] INFO o.e.j.w.StandardDescriptorProcessor#visitServlet
: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
2023-07-18 05:44:37.184+0000 [id=1] INFO o.e.j.s.s.DefaultSessionIdManager#doStart: Sessi
on workerName=node0
2023-07-18 05:44:38.272+0000 [id=1] INFO hudson.WebAppMain#contextInitialized: Jenkins ho
me directory: /var/jenkins_home found at: EnvVars.masterEnvVars.get(“JENKINS_HOME”)
2023-07-18 05:44:38.678+0000 [id=1] INFO o.e.j.s.handler.ContextHandler#doStart: Started
w.@692e028d{Jenkins v2.401.2,/,file:///var/jenkins_home/war/,AVAILABLE}{/var/jenkins_home/war}
2023-07-18 05:44:38.725+0000 [id=1] INFO o.e.j.server.AbstractConnector#doStart: Started
ServerConnector@1755e85b{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
2023-07-18 05:44:38.766+0000 [id=1] INFO org.eclipse.jetty.server.Server#doStart: Started
Server@55342f40{STARTING}[10.0.13,sto=0] @6745ms
2023-07-18 05:44:38.774+0000 [id=24] INFO winstone.Logger#logInternal: Winstone Servlet En
gine running: controlPort=disabled
2023-07-18 05:44:39.302+0000 [id=31] INFO jenkins.InitReactorRunner$1#onAttained: Started
initialization
2023-07-18 05:44:39.342+0000 [id=30] INFO jenkins.InitReactorRunner$1#onAttained: Listed a
ll plugins
2023-07-18 05:44:41.270+0000 [id=30] INFO jenkins.InitReactorRunner$1#onAttained: Prepared
all plugins
2023-07-18 05:44:41.283+0000 [id=32] INFO jenkins.InitReactorRunner$1#onAttained: Started
all plugins
2023-07-18 05:44:41.299+0000 [id=31] INFO jenkins.InitReactorRunner$1#onAttained: Augmente
d all extensions
2023-07-18 05:44:41.737+0000 [id=36] INFO jenkins.InitReactorRunner$1#onAttained: System c
onfig loaded
2023-07-18 05:44:41.740+0000 [id=30] INFO jenkins.InitReactorRunner$1#onAttained: System c
onfig adapted
2023-07-18 05:44:41.742+0000 [id=30] INFO jenkins.InitReactorRunner$1#onAttained: Loaded a
ll jobs
2023-07-18 05:44:41.746+0000 [id=30] INFO jenkins.InitReactorRunner$1#onAttained: Configur
ation for all jobs updated
2023-07-18 05:44:41.845+0000 [id=49] INFO hudson.util.Retrier#start: Attempt #1 to do the
action check updates server
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (file:/var/jenkins
_home/war/WEB-INF/lib/groovy-all-2.4.21.jar) to constructor java.lang.invoke.MethodHandles$Looku
p(java.lang.Class,int)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Ja
va7$1
WARNING: Use –illegal-access=warn to enable warnings of further illegal reflective access opera
tions
WARNING: All illegal access operations will be denied in a future release
2023-07-18 05:44:42.863+0000 [id=36] INFO jenkins.install.SetupWizard#init:




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

e5b683d3c80844e8a06e69768c323b4c

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




at java.base/java.lang.Thread.run(Thread.java:829)
2023-07-18 05:44:43.087+0000 [id=36] INFO jenkins.InitReactorRunner$1#onAttained: Complete
d initialization
2023-07-18 05:44:43.120+0000 [id=49] INFO hudson.util.Retrier#start: Attempted the action
check updates server for 1 time(s) with no success
2023-07-18 05:44:43.135+0000 [id=49] SEVERE hudson.PluginManager#doCheckUpdatesServer: Error
checking update sites for 1 attempt(s). Last exception was: SSLHandshakeException: PKIX path bu
ilding failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid
certification path to requested target
2023-07-18 05:44:43.201+0000 [id=23] INFO hudson.lifecycle.Lifecycle#onReady: Jenkins is f
ully up and running