【实战练习】通过docker部署jenkins
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了【实战练习】通过docker部署jenkins,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含16068字,纯文字阅读大概需要23分钟。
内容图文
Official Jenkins Docker image
[ root@ip - 172 - 31 - 16 - 58 ec2 - user ]# docker pull jenkins / jenkins
Using default tag : latest
latest : Pulling from jenkins / jenkins
06b22ddb1913 : Pull complete
336c28b408ed : Pull complete
1f3e6b8d80c3 : Pull complete
5ccc640979f6 : Pull complete
14eaa20184e6 : Pull complete
19a8522e2399 : Pull complete
39ba9d7befca : Pull complete
1f81f3143db2 : Pull complete
2034c15120cd : Pull complete
cb9c7784507a : Pull complete
160eb3637188 : Pull complete
6f0079684645 : Pull complete
d03cc51cd013 : Pull complete
5c83a5102435 : Pull complete
d1615ed88d09 : Pull complete
184c2f70a0cf : Pull complete
468b123e967f : Pull complete
f1ae15a4cfc0 : Pull complete
02f7a795bd75 : Pull complete
bdac05821dbe : Pull complete
Digest : sha256 : 30f648f79d447aab092a1a8a2025ee90e257fc03245796a89fb8ffac638259ee
Status : Downloaded newer image for jenkins / jenkins : latest
docker run 命令详细文档
[ root@ip - 172 - 31 - 16 - 58 ec2 - user ]# docker run -- help
Usage : docker run [ OPTIONS ] IMAGE [ COMMAND ] [ ARG ...]
Run a command in a new container
Options :
-- add - host list Add a custom host - to - IP mapping ( host : ip ) ( default [])
- a , -- attach list Attach to STDIN , STDOUT or STDERR ( default [])
-- blkio - weight uint16 Block IO ( relative weight ), between 10 and 1000 , or 0 to disable ( default 0 )
-- blkio - weight - device weighted - device Block IO weight ( relative device weight ) ( default [])
-- cap - add list Add Linux capabilities ( default [])
-- cap - drop list Drop Linux capabilities ( default [])
-- cgroup - parent string Optional parent cgroup for the container
-- cidfile string Write the container ID to the file
-- cpu - count int CPU count ( Windows only )
-- cpu - percent int CPU percent ( Windows only )
-- cpu - period int Limit CPU CFS ( Completely Fair Scheduler ) period
-- cpu - quota int Limit CPU CFS ( Completely Fair Scheduler ) quota
-- cpu - rt - period int Limit CPU real - time period in microseconds
-- cpu - rt - runtime int Limit CPU real - time runtime in microseconds
- c , -- cpu - shares int CPU shares ( relative weight ) //用于给运行在容器中的所有进程分配CPU的shares值。这是一个相对权重,实际的处理速度还与宿主机CPU相关
-- cpus decimal Number of CPUs ( default 0.000 )
-- cpuset - cpus string CPUs in which to allow execution ( 0 - 3 , 0 , 1 )
-- cpuset - mems string MEMs in which to allow execution ( 0 - 3 , 0 , 1 )
-- credentialspec string Credential spec for managed service account ( Windows only )
- d , -- detach Run container in background and print container ID
-- detach - keys string Override the key sequence for detaching a container
-- device list Add a host device to the container ( default [])
-- device - read - bps throttled - device Limit read rate ( bytes per second ) from a device ( default [])
-- device - read - iops throttled - device Limit read rate ( IO per second ) from a device ( default [])
-- device - write - bps throttled - device Limit write rate ( bytes per second ) to a device ( default [])
-- device - write - iops throttled - device Limit write rate ( IO per second ) to a device ( default [])
-- disable - content - trust Skip image verification ( default true )
-- dns list Set custom DNS servers ( default [])
-- dns - option list Set DNS options ( default [])
-- dns - search list Set custom DNS search domains ( default [])
-- entrypoint string Overwrite the default ENTRYPOINT of the image
- e , -- env list Set environment variables ( default [])
-- env - file list Read in a file of environment variables ( default [])
-- expose list Expose a port or a range of ports ( default [])
-- group - add list Add additional groups to join ( default [])
-- health - cmd string Command to run to check health
-- health - interval duration Time between running the check ( ns | us | ms | s | m | h ) ( default 0s )
-- health - retries int Consecutive failures needed to report unhealthy
-- health - timeout duration Maximum time to allow one check to run ( ns | us | ms | s | m | h ) ( default 0s )
-- help Print usage
- h , -- hostname string Container host name
-- init Run an init inside the container that forwards signals and reaps processes
-- init - path string Path to the docker - init binary
- i , -- interactive Keep STDIN open even if not attached //保持输入打开即使不连接 即选择交互模式,始终保持输入流开放
-- io - maxbandwidth string Maximum IO bandwidth limit for the system drive ( Windows only )
-- io - maxiops uint Maximum IOps limit for the system drive ( Windows only )
-- ip string Container IPv4 address ( e . g . 172.30 . 100.104 )
-- ip6 string Container IPv6 address ( e . g . 2001 : db8 :: 33 )
-- ipc string IPC namespace to use
-- isolation string Container isolation technology
-- kernel - memory string Kernel memory limit
- l , -- label list Set meta data on a container ( default [])
-- label - file list Read in a line delimited file of labels ( default [])
-- link list Add link to another container ( default [])
-- link - local - ip list Container IPv4 / IPv6 link - local addresses ( default [])
-- log - driver string Logging driver for the container
-- log - opt list Log driver options ( default [])
-- mac - address string Container MAC address ( e . g . 92 : d0 : c6 : 0a : 29 : 33 )
- m , -- memory string Memory limit //限制容器为所有进程分配的内存总量
-- memory - reservation string Memory soft limit
-- memory - swap string Swap limit equal to memory plus swap : ‘-1‘ to enable unlimited swap
-- memory - swappiness int Tune container memory swappiness ( 0 to 100 ) ( default - 1 )
-- name string Assign a name to the container
-- network string Connect a container to a network ( default "default" )
-- network - alias list Add network - scoped alias for the container ( default [])
-- no - healthcheck Disable any container - specified HEALTHCHECK
-- oom - kill - disable Disable OOM Killer
-- oom - score - adj int Tune host ‘s OOM preferences (-1000 to 1000)
--pid string PID namespace to use
--pids-limit int Tune container pids limit (set -1 for unlimited)
--privileged Give extended privileges to this container
-p, --publish list Publish a container‘ s port ( s ) to the host ( default []) //端口映射到本机 将容器的端口暴漏给宿主机的端口
- P , -- publish - all Publish all exposed ports to random ports
-- read - only Mount the container ‘s root filesystem as read only
--restart string Restart policy to apply when a container exits (default "no")
--rm Automatically remove the container when it exits
--runtime string Runtime to use for this container
--security-opt list Security Options (default [])
--shm-size string Size of /dev/shm, default value is 64MB
--sig-proxy Proxy received signals to the process (default true)
--stop-signal string Signal to stop a container, SIGTERM by default (default "SIGTERM")
--stop-timeout int Timeout (in seconds) to stop a container
--storage-opt list Storage driver options for the container (default [])
--sysctl map Sysctl options (default map[])
--tmpfs list Mount a tmpfs directory (default [])
-t, --tty Allocate a pseudo-TTY //分配一个伪终端,一般两个参数结合是使用 -it,就可以在容器中利用打开的伪终端进行交互操作
--ulimit ulimit Ulimit options (default [])
-u, --user string Username or UID (format: <name|uid>[:<group|gid>])
--userns string User namespace to use
--uts string UTS namespace to use
-v, --volume list Bind mount a volume (default []) //用户挂载一个volume 可以用多个-v挂载读个 。volume的格式为[host-dir]:[container-dir]:[rw|ro]
--volume-driver string Optional volume driver for the container
--volumes-from list Mount volumes from the specified container(s) (default [])
-w, --workdir string Working directory inside the container
[ root@ip - 172 - 31 - 16 - 58 ec2 - user ]# docker run - p 8080 : 8080 - p 50000 : 50000 - v jenkins_home : /var/ jenkins_home jenkins / jenkins
docker : Error response from daemon : driver failed programming external connectivity on endpoint elegant_darwin ( 1597358b18b14e84246118d59c368cd17fb7eee2928c2e918305ca511bcae754 ): Error starting userland proxy : listen tcp 0.0 . 0.0 : 8080 : bind : address already in use .
[ root@ip - 172 - 31 - 16 - 58 ec2 - user ]# docker run - p 8080 : 8081 - p 50000 : 50000 - v jenkins_home : /var/ jenkins_home jenkins / jenkins
docker : Error response from daemon : driver failed programming external connectivity on endpoint frosty_yonath ( 67bfcad0fa9e58200dbccd10ad69a1939fb70c128ab586dd23fc1608e6f33de7 ): Error starting userland proxy : listen tcp 0.0 . 0.0 : 8080 : bind : address already in use .
[ root@ip - 172 - 31 - 16 - 58 ec2 - user ]# docker run - p 8081 : 8080 - p 50000 : 50000 - v jenkins_home : /var/ jenkins_home jenkins / jenkins
Running from : /usr/ share / jenkins / jenkins . war
webroot : EnvVars . masterEnvVars . get ( "JENKINS_HOME" )
Jul 25 , 2017 8 : 21 : 05 AM Main deleteWinstoneTempContents
WARNING : Failed to delete the temporary Winstone file / tmp / winstone / jenkins . war
Jul 25 , 2017 8 : 21 : 06 AM org . eclipse . jetty . util . log . Log initialized
INFO : Logging initialized @ 1202ms to org . eclipse . jetty . util . log . JavaUtilLog
Jul 25 , 2017 8 : 21 : 06 AM winstone . Logger logInternal
INFO : Beginning extraction from war file
Jul 25 , 2017 8 : 21 : 07 AM org . eclipse . jetty . server . handler . ContextHandler setContextPath
WARNING : Empty contextPath
Jul 25 , 2017 8 : 21 : 08 AM org . eclipse . jetty . server . Server doStart
INFO : jetty - 9.4 . z - SNAPSHOT
Jul 25 , 2017 8 : 21 : 08 AM org . eclipse . jetty . webapp . StandardDescriptorProcessor visitServlet
INFO : NO JSP Support for /, did not find org . eclipse . jetty . jsp . JettyJspServlet
Jul 25 , 2017 8 : 21 : 08 AM org . eclipse . jetty . server . session . DefaultSessionIdManager doStart
INFO : DefaultSessionIdManager workerName = node0
Jul 25 , 2017 8 : 21 : 08 AM org . eclipse . jetty . server . session . DefaultSessionIdManager doStart
INFO : No SessionScavenger set , using defaults
Jul 25 , 2017 8 : 21 : 08 AM org . eclipse . jetty . server . session . HouseKeeper startScavenging
INFO : Scavenging every 660000ms
Jenkins home directory : /var/ jenkins_home found at : EnvVars . masterEnvVars . get ( "JENKINS_HOME" )
Jul 25 , 2017 8 : 21 : 09 AM org . eclipse . jetty . server . handler . ContextHandler doStart
INFO : Started w .@ 62e70ea3 { /,file:/ //var/jenkins_home/war/,AVAILABLE}{/var/jenkins_home/war}
Jul 25 , 2017 8 : 21 : 09 AM org . eclipse . jetty . server . AbstractConnector doStart
INFO : Started ServerConnector@25ddbbbb { HTTP / 1.1 ,[ http / 1.1 ]}{ 0.0 . 0.0 : 8080 }
Jul 25 , 2017 8 : 21 : 09 AM org . eclipse . jetty . server . Server doStart
INFO : Started @ 4942ms
Jul 25 , 2017 8 : 21 : 09 AM winstone . Logger logInternal
INFO : Winstone Servlet Engine v4 . 0 running : controlPort = disabled
Jul 25 , 2017 8 : 21 : 10 AM jenkins . InitReactorRunner$1 onAttained
INFO : Started initialization
Jul 25 , 2017 8 : 21 : 10 AM jenkins . InitReactorRunner$1 onAttained
INFO : Listed all plugins
Jul 25 , 2017 8 : 21 : 13 AM jenkins . InitReactorRunner$1 onAttained
INFO : Prepared all plugins
Jul 25 , 2017 8 : 21 : 13 AM jenkins . InitReactorRunner$1 onAttained
INFO : Started all plugins
Jul 25 , 2017 8 : 21 : 13 AM jenkins . InitReactorRunner$1 onAttained
INFO : Augmented all extensions
Jul 25 , 2017 8 : 21 : 15 AM jenkins . InitReactorRunner$1 onAttained
INFO : Loaded all jobs
Jul 25 , 2017 8 : 21 : 15 AM hudson . model . AsyncPeriodicWork$1 run
INFO : Started Download metadata
Jul 25 , 2017 8 : 21 : 16 AM jenkins . util . groovy . GroovyHookScript execute
INFO : Executing / var / jenkins_home / init . groovy . d / tcp - slave - agent - port . groovy
Jul 25 , 2017 8 : 21 : 16 AM jenkins . InitReactorRunner$1 onAttained
INFO : Completed initialization
Jul 25 , 2017 8 : 21 : 17 AM org . springframework . context . support . AbstractApplicationContext prepareRefresh
INFO : Refreshing org . springframework . web . context . support . StaticWebApplicationContext@6f1a6ab9 : display name [ Root WebApplicationContext ]; startup date [ Tue Jul 25 08 : 21 : 17 UTC 2017 ]; root of context hierarchy
Jul 25 , 2017 8 : 21 : 17 AM org . springframework . context . support . AbstractApplicationContext obtainFreshBeanFactory
INFO : Bean factory for application context [ org . springframework . web . context . support . StaticWebApplicationContext@6f1a6ab9 ]: org . springframework . beans . factory . support . DefaultListableBeanFactory@70246b4f
Jul 25 , 2017 8 : 21 : 17 AM org . springframework . beans . factory . support . DefaultListableBeanFactory preInstantiateSingletons
INFO : Pre - instantiating singletons in org . springframework . beans . factory . support . DefaultListableBeanFactory@70246b4f : defining beans [ authenticationManager ]; root of factory hierarchy
Jul 25 , 2017 8 : 21 : 18 AM org . springframework . context . support . AbstractApplicationContext prepareRefresh
INFO : Refreshing org . springframework . web . context . support . StaticWebApplicationContext@3519c206 : display name [ Root WebApplicationContext ]; startup date [ Tue Jul 25 08 : 21 : 18 UTC 2017 ]; root of context hierarchy
Jul 25 , 2017 8 : 21 : 18 AM org . springframework . context . support . AbstractApplicationContext obtainFreshBeanFactory
INFO : Bean factory for application context [ org . springframework . web . context . support . StaticWebApplicationContext@3519c206 ]: org . springframework . beans . factory . support . DefaultListableBeanFactory@5ec0f5c8
Jul 25 , 2017 8 : 21 : 18 AM org . springframework . beans . factory . support . DefaultListableBeanFactory preInstantiateSingletons
INFO : Pre - instantiating singletons in org . springframework . beans . factory . support . DefaultListableBeanFactory@5ec0f5c8 : defining beans [ filter , legacy ]; root of factory hierarchy
Jul 25 , 2017 8 : 21 : 19 AM 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 :
89389c1eefaf48e3a9a7caa94abbc59d
This may also be found at : /var/ jenkins_home / secrets / initialAdminPassword
*************************************************************
*************************************************************
*************************************************************
Jul 25 , 2017 8 : 21 : 23 AM hudson . model . UpdateSite updateData
INFO : Obtained the latest update center data file for UpdateSource default
Jul 25 , 2017 8 : 21 : 23 AM hudson . model . DownloadService$Downloadable load
INFO : Obtained the updated data file for hudson . tasks . Maven . MavenInstaller
Jul 25 , 2017 8 : 21 : 25 AM hudson . model . DownloadService$Downloadable load
INFO : Obtained the updated data file for hudson . tools . JDKInstaller
Jul 25 , 2017 8 : 21 : 25 AM hudson . model . AsyncPeriodicWork$1 run
INFO : Finished Download metadata . 9 , 840 ms
Jul 25 , 2017 8 : 21 : 25 AM hudson . model . UpdateSite updateData
INFO : Obtained the latest update center data file for UpdateSource default
Jul 25 , 2017 8 : 21 : 25 AM hudson . WebAppMain$3 run
INFO : Jenkins is fully up and running
--> setting agent port for jnlp
--> setting agent port for jnlp ... done
原文:http://www.cnblogs.com/wolfgang-/p/7240165.html
内容总结
以上是互联网集市为您收集整理的【实战练习】通过docker部署jenkins全部内容,希望文章能够帮你解决【实战练习】通过docker部署jenkins所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。