debain docker 安装jenkins


换成国内源

  • 备份原有的源配置文件

    cp /etc/apt/sources.list /etc/apt/sources.listbak 
  • 删除该源配置文件

    rm -f /etc/apt/sources.list
  • 生成国内的源配置文件

    echo "deb http://ftp.cn.debian.org/debian/ stretch main" > /etc/apt/sources.list
    echo "deb http://ftp.cn.debian.org/debian/ stretch-updates main" >> /etc/apt/sources.list 
    echo "deb http://ftp.cn.debian.org/debian-security stretch/updates main" >> /etc/apt/sources.list
  • 更新源

    apt-get update

安装常用软件

  • curl

    apt-get install curl
  • wget

    apt-get install wget
  • vim

    apt-get install vim
  • jdk

    apt install openjdk-8-jdk

安装jenkins(root权限)

  • Import the GPG keys of the Jenkins repository

    root权限使用

    wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | apt-key add -

    非root权限使用

    wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
  • add the Jenkins repository to your system
    root权限使用

    sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'

    非root权限使用

    sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
  • Update the apt package list and install the latest version of Jenkins by running

    root权限使用

    apt update
    apt install jenkins

    非root权限使用

    sudo apt update
    sudo apt install jenkins
  • Start the Jenkins service and enable it to automatically start on boot

    root权限使用

    systemctl start jenkins
    systemctl enable jenkins

    非root权限使用

    sudo systemctl start jenkins
    sudo systemctl enable jenkins

文章作者: Hienao
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 Hienao !
评论
  目录