章工运维 章工运维
首页
  • linux
  • windows
  • 中间件
  • 监控
  • 网络
  • 存储
  • 安全
  • 防火墙
  • 数据库
  • 系统
  • docker
  • 运维工具
  • other
  • elk
  • K8S
  • ansible
  • Jenkins
  • GitLabCI_CD
  • 随笔
  • 面试
  • 工具
  • 收藏夹
  • Shell
  • python
  • golang
友链
  • 索引

    • 分类
    • 标签
    • 归档
    • 首页 (opens new window)
    • 关于我 (opens new window)
    • 图床 (opens new window)
    • 评论 (opens new window)
    • 导航栏 (opens new window)
周刊
GitHub (opens new window)

章工运维

业精于勤,荒于嬉
首页
  • linux
  • windows
  • 中间件
  • 监控
  • 网络
  • 存储
  • 安全
  • 防火墙
  • 数据库
  • 系统
  • docker
  • 运维工具
  • other
  • elk
  • K8S
  • ansible
  • Jenkins
  • GitLabCI_CD
  • 随笔
  • 面试
  • 工具
  • 收藏夹
  • Shell
  • python
  • golang
友链
  • 索引

    • 分类
    • 标签
    • 归档
    • 首页 (opens new window)
    • 关于我 (opens new window)
    • 图床 (opens new window)
    • 评论 (opens new window)
    • 导航栏 (opens new window)
周刊
GitHub (opens new window)
  • ansible系列文章

  • Kubernetes笔记

  • elk

  • jenkins

    • jenkins容器安装
    • jenkins流水线语法介绍
    • jenkins常用插件汇总及介绍
    • jenkins配置连接slave从节点
    • jenkins配置android发布
    • jenkins配置ios发布
    • jenkins使用rpm方式安装
    • jenkins部署java程序
    • jenkins部署vue程序
    • jenkins使用流水线部署go程序
  • GitLabCI_CD

  • 专题
  • jenkins
章工运维
2022-12-15

jenkins容器安装

# 安装的dockerfile

FROM jenkins/jenkins:2.332.3

USER root
RUN echo '' > /etc/apt/sources.list \
&& echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free" > /etc/apt/sources.list \
&& echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free" >> /etc/apt/sources.list \
&& echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free" >> /etc/apt/sources.list \
&& echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free" >> /etc/apt/sources.list \
&& apt update \
&& apt install sudo -y \
&& apt install vim -y \
&& apt install sshpass -y \
&& apt install python -y \
&& sed -i '27a\jenkins ALL=(ALL)       NOPASSWD:ALL' /etc/sudoers
USER jenkins
ENV LANG C.UTF-8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

# docker-compose文件

version: '3'
services:
  jenkins:
    image: di.zzppjj.top/library/jenkins:v6
    container_name: jenkins
    restart: always
    ports:
      - '8000:8080'
      - '50000:50000'
    environment:
      JAVA_OPTS: -Duser.timezone=Asia/Shanghai
    extra_hosts:
      - "di.zzppjj.top:172.16.30.215"
    volumes:
      - /data/jenkins/jenkins_home:/var/jenkins_home
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock
      - /usr/bin/docker:/usr/bin/docker  
      - /data:/data
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
微信 支付宝
上次更新: 2023/02/23, 18:13:16

← 使用docker构建ElasticSearch集群 jenkins流水线语法介绍→

最近更新
01
不花一分钱从0到1建站教程
04-22
02
批量拿取多台服务器的日志文件
04-21
03
高德MCP智能体搞定旅游计划
04-19
更多文章>
Theme by Vdoing | Copyright © 2019-2025 | 点击查看十年之约 | 鄂ICP备2024072800号
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式