hj_服务器操作记录04_podman安装Jenkins

 

[root@iZc3hwg7f2i7mfZ hj_jenkins_mount]# lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOSStream
Description: CentOS Stream release 8
Release: 8
Codename: n/a

 

1->下载镜像  podman pull jenkins:2.60.3     

[root@iZc3hwg7f2i7mfZ ~]# podman pull jenkins:2.60.3
✔ docker.io/library/jenkins:2.60.3
Trying to pull docker.io/library/jenkins:2.60.3...
Getting image source signatures
Copying blob 9a8ea045c926 done  
...                                              选项选择docker.io前缀的这个
Copying config cd14cecfdb done  
Writing manifest to image destination
Storing signatures
cd14cecfdb3a657ba7d05bea026e7ac8b9abafc6e5c66253ab327c7211fa6281
[root@iZc3hwg7f2i7mfZ ~]# 

2> 安装镜像   mkdir /home/hj_jenkins_mount  touch docker.sock <--前提准备

podman run \
-u root \
--rm \
-d \
-p 9999:8080 \
-p 9998:50000 \
-v /home/hj_jenkins_mount:/var/jenkins_home \
-v /home/hj_jenkins_mount/docker.sock:/var/run/docker.sock \
--name hj_jenkins_2.60.3 \
cd14cecfdb3a

[root@iZc3hwg7f2i7mfZ hj_jenkins_mount]# podman run   -u root   --rm   -d   -p 9999:8080   -p 9998:50000   -v /home/hj_jenkins_mount:/var/jenkins_home   -v /home/hj_jenkins_mount/docker.sock:/var/run/docker.sock   --name hj_jenkins_2.60.3   cd14cecfdb3a
32428cf0d3deaa814e38d2e16e1901b8863dbae2c9cfadaea1436f52c84aeb09
[root@iZc3hwg7f2i7mfZ hj_jenkins_mount]# podman ps
CONTAINER ID  IMAGE                             COMMAND               CREATED             STATUS                 PORTS                                            NAMES
32428cf0d3de  docker.io/library/jenkins:2.60.3                        About a minute ago  Up About a minute ago  0.0.0.0:9999->8080/tcp, 0.0.0.0:9998->50000/tcp  hj_jenkins_2.60.3
[root@iZc3hwg7f2i7mfZ hj_jenkins_mount]# 

  访问 9999接口 初始密码在 /home/hj_jenkins_mount/secrets 下的initialAdminPassword文件 cat initialAdminPassword查看即可

新玩法:->

docker pull jenkinsci/blueocean:1.25.5 (推荐这个)

[root@iZc3hwg7f2i7mfZ hj_jenkins_mount]# podman pull jenkinsci/blueocean:1.25.5
Resolved "jenkinsci/blueocean" as an alias (/var/cache/containers/short-name-aliases.conf)
Trying to pull docker.io/jenkinsci/blueocean:1.25.5...
Getting image source signatures
Copying blob e630dc78387e done  

podman run \
-u root \
--rm \
-d \
-p 9999:8080 \
-p 9998:50000 \
-v /home/hj_jenkins_mount:/var/jenkins_home \
-v /home/hj_jenkins_mount/docker.sock:/var/run/docker.sock \
--name hj_jenkinsci_blueocean_1.25.5 \
978e6374740b

 podman exec -it -u root e07c44bd14f7 bash

podman cp e07c44bd14f7:/var/jenkins_home/. /home/

其他----待继续写

posted @ 2021-12-27 15:47  独孤~华剑  阅读(177)  评论(0编辑  收藏  举报
独孤华剑