首页 > 其他分享 >Docker部署jenkins

Docker部署jenkins

时间:2022-08-23 19:01:54浏览次数:67  
标签:Pull container complete kB 部署 Copying jenkins Docker

https://www.cnblogs.com/hiyong/p/14405561.html

1. 下载Image

[root@server /]# docker pull jenkins/jenkins
Using default tag: latest
latest: Pulling from jenkins/jenkins
3192219afd04: Already exists 
17c160265e75: Already exists 
cc4fe40d0e61: Already exists 
9d647f502a07: Already exists 
d108b8c498aa: Already exists 
1bfe918b8aa5: Already exists 
dafa1a7c0751: Already exists 
c69d355c63ac: Pull complete 
b15898bb1800: Pull complete 
a51ccfc981f7: Pull complete 
49f46bd4bf74: Pull complete 
efa670fd97de: Pull complete 
1565294bcba3: Pull complete 
4c51bcfbed1e: Pull complete 
49f4fafbfbf2: Pull complete 
28a75541fa5f: Pull complete 
c3c03c2d5564: Pull complete 
ace64d1af7cf: Pull complete 
f1960af3b8ab: Pull complete 
6fd1a5a6d017: Pull complete 
Digest: sha256:e4630b9084110ad05b4b51f5131d62161881216d60433d1f2074d522c3dcd6dc
Status: Downloaded newer image for jenkins/jenkins:latest
docker.io/jenkins/jenkins:latest

2. 创建docker的文件影射卷,用户数据存储

[root@server tmp]# docker volume create jenkins_test
[root@server tmp]# docker volume inspect jenkins_test
[
    {
        "CreatedAt": "2020-07-18T10:49:17+08:00",
        "Driver": "local",
        "Labels": {},
        "Mountpoint": "/var/lib/docker/volumes/jenkins_test/_data",
        "Name": "jenkins_test",
        "Options": {},
        "Scope": "local"
    }
]
[root@server tmp]# 
View Code

 

3.创建container

[root@server /]# docker run --name=jenkins -d -p 8080:8080 -p 50000:50000 -v jenkins_test:/var/jenkins_home jenkins/jenkins
c7fb87aec99402febd95edddda5cf1dc7ad15437f674bf71a09692d93369ccb9
[root@server /]# 
[root@server /]# docker ps
CONTAINER ID   IMAGE             COMMAND                  CREATED         STATUS         PORTS                                              NAMES
c7fb87aec994   jenkins/jenkins   "/sbin/tini -- /usr/…"   9 minutes ago   Up 9 minutes   0.0.0.0:8080->8080/tcp, 0.0.0.0:50000->50000/tcp   jenkins
View Code

浏览器输入电脑IP地址+端口号:http://192.168.2.188:8080/

 

 

 

查看密码有两种方法:

#方法1:cat
docker exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword

#方法2: 将文件从容器复制到服务器再查看
[root@localhost jenkins_home]# docker  cp jenkins:/jenkins_test/secrets/initialAdminPassword secrets/initialAdminPassword 
invalid output path: directory "/var/jenkins_home/secrets" does not exist

后改为如下命令成功,应该是权限的问题
[root@localhost jenkins_home]# docker cp jenkins:/var/jenkins_home/secrets secrets/ 
Preparing to copy...
Copying from container - 512B
Copying from container - 1.024kB
Copying from container - 1.057kB
Copying from container - 1.536kB
Copying from container - 2.048kB
Copying from container - 2.08kB
Copying from container - 2.56kB
Copying from container - 3.072kB
Copying from container - 3.328kB
Copying from container - 3.584kB
Copying from container - 4.096kB
Successfully copied 4.608kB to /var/jenkins_home/secrets/
[root@localhost jenkins_home]# ls -a
.  ..  secrets
View Code

输入密码后开始配置:

 

标签:Pull,container,complete,kB,部署,Copying,jenkins,Docker
From: https://www.cnblogs.com/anan1688/p/16617421.html

相关文章

  • docker compose ipv6的处理
    简介:dockercompose是我常用的容器编排工具,至今没有升级到K8S,汗那么compose的yaml配置的容器如何互联呢?常见的恐怕就是上次折腾nginx的那一次了。一个nginx,反向代理a......
  • ubantu16.04,docker-ce-17.09,docker runc容器逃逸漏洞(CVE-2021-30465)修复
    背景ubantu16.04TLSdocker-ce-17.09.1(比较老的版本可能都有这个漏洞,而且dockerversion查不到runc版本,也没有runc文件,只有docker-runc一个文件)解决方案下载对接系统......
  • K8s小白?应用部署太难?看这篇就够了!
    在云原生趋势下,容器和Kubernetes可谓是家喻户晓,许多企业内部的研发团队都在使用Kubernetes打造DevOps平台。从最早的容器概念到Kubernetes再到DevOps/GitOps整个......
  • windows10安装podman desktop替代docker desktop
    原因:我安装的版本为V4.2.0的,后续有更新请选择更新的tag去下载1、下载podman:1.1、访问github地址,https://github.com/containers/podman/releases/tag/v4.2.01.2、下载......
  • dockerfile deploy
    Failedtodeploy'baseDockerfile:Base/Dockerfile':java.lang.RuntimeException:com.fasterxml.jackson.databind.JsonMappingException:NullkeyforaMapnota......
  • 通过部署流行 Web 框架掌握 Serverless 技术
    作者:小院里的霍大侠大家好,我是霍大侠,本篇我们通过学习部署流行Web框架,如SpringBoot,Express,WebIDE,让你掌握Serverless函数计算架构和技术,领略弹性并发、高可用的好......
  • docker安装
    注:如果已经是root用户,忽略sudo1.卸载旧版本sudoyumremovedocker\docker-client\docker-client-latest\......
  • 如何在docker中创建volume?
    在docker中,通过如下的命令创建volume: #my_volume_01是自定义的volume的名字dockervolumecreatemy_volume_01  查看创建的volume dockervolumels......
  • docker之rabbitmq delayed message exchange
    创建dockerfileFROMrabbitmq:3.9.11-management-alpineCOPYrabbitmq_delayed_message_exchange-3.9.0.ez/pluginsRUNrabbitmq-pluginsenablerabbitmq_delayed_me......
  • App Deploy as Code! SAE & Terraform 实现 IaC 式部署应用
    作者:宋阳(流鑫)企业上云是近些年的发展热潮,越来越多的企业把自己的应用部署在各个云厂商中,利用云计算带来的弹性、灵活、安全、低成本等特性,轻松帮助企业搭建自己的应用。......