docker中Jenkins容器启动失败

2017-11-1 liyangweb.com 李杨 服务器

今天在docker中启动jenkins容器时,按照官方文档中的方法执行:

docker run -p 8080:8080 -p 50000:50000 -v /your/home:/var/jenkins_home jenkins

遇到了一个权限问题,报错为:

Can not write to /var/jenkins_home/copy_reference_file.log. Wrong volume permissions?

touch: cannot touch ‘/var/jenkins_home/copy_reference_file.log’: Permission denied

原因是Jenkins镜像内部使用的用户是jenkons,但是我们启动容器时的账号是root,导致没有权限操作内部目录,我们可以稍微改一下上面的命令:
docker run -p 8080:8080 -p 50000:50000 -v /your/home:/var/jenkins_home -u 0 jenkins
这样就启动成功了。


这命令的意思是覆盖容器中内置的帐号,该用外部传入,这里传入0代表的是root帐号Id。这样再启动的时候就应该没问题了。



标签: docker jenkins

评论:

carrymebike
2019-01-25 02:47
<a href="http://www.niskutruckstop.net/kobe-9-sko-r%C3%B8d-scarpee">kobe 9 sko r酶d</a> <a href="http://www.osborneandmiller.net/air-jordan-jumpman-team-rosso-bianca-kurpesa">air jordan jumpman team rosso bianca</a> <a href="http://www.pclighthouse.net/maschio-nike-flyknit-racer-arancia-grigio-kurpesc">maschio nike flyknit racer arancia grigio</a> <a href="http://www.peeplesvalleyfire.net/nike-kobe-11-flyknit-hombres-multicolor-obuva">nike kobe 11 flyknit hombres multicolor</a> <a href="http://www.peninsulavineyard.net/nike-free-flyknit-4.0-v2-blanco-naranja-schuhef">nike free flyknit 4.0 v2 blanco naranja</a> <a href="http://www.petlandiapetcare.net/adidas-rose-6-plata-naranja-chaussuresg">adidas rose 6 plata naranja</a>
carrymebike http://www.carrymebike.net/
cremontana
2019-01-05 15:55
<a href="http://www.atolyekarinca.com/nike-kd-8-mens-red-silver-runningf">nike kd 8 mens red silver</a> <a href="http://www.dfarrie.com/zdeno-chara-33-boston-bruins-reebok-premier-alternate-jersey-small-nflv">zdeno chara 33 boston bruins reebok premier alternate jersey small</a> <a href="http://www.mwsuperstore.com/nike-air-jordan-6-slam-dunk-trainersa">nike air jordan 6 slam dunk</a> <a href="http://www.shanamorgan.com/nike-dynamo-free-ps-barn-brun-svart-scarped">nike dynamo free ps barn brun svart</a> <a href="http://www.crisgarrett.com/nike-flynit-air-max-dam%C3%A4nner-gold-rot-kurpesd">nike flynit air max dam盲nner gold rot</a> <a href="http://www.rejuvmedia.com/genuine-ray-ban-sunglasses-uk-sunglassesd">genuine ray ban sunglasses uk</a>
[url=http://www.cremontana.com/]cremontana[/url]
aquaboutic
2018-12-28 03:15
<a href="http://www.iediagx.com/nike-lebron-12-low-grau-blau-grau-wei%C3%9F-hair-obuvg">nike lebron 12 low grau blau grau wei脽 hair</a> <a href="http://www.juniorensea.com/air-jordan-super-fly-bleu-gris-kurpesa">air jordan super fly bleu gris</a> <a href="http://www.lorenbenjamin.com/air-jordan-retro-14-rouge-bleu-ciel-kurpese">air jordan retro 14 rouge bleu ciel</a> <a href="http://www.vcclassify.com/womens-ralph-lauren-short-khaki-grey-poloz">womens ralph lauren short khaki grey</a> <a href="http://www.amrservicio.com/nike-free-5.0-volt-hyper-bl%C3%A5-sort-barely-volt-scarpeb">nike free 5.0 volt hyper bl氓 sort barely volt</a> <a href="http://www.biotechsurvey.com/limited-youth-lamar-miller-olive-jersey-nfl-nike-houston-texans-26-2017-salute-to-service-nfls">limited youth lamar miller olive jersey nfl nike houston texans 26 2017 salute to service</a>
aquaboutic http://www.aquaboutic.com/
新闻头条
2017-11-07 16:16
文章不错支持一下吧,,非常喜欢

发表评论:

Powered by emlog 冀ICP备13011830号-1