安装jenkins,配置pipline 运行docker

1.安装安装docker;

2.安装jenkins:

       docker run -u root -d -p 8000:8080 -p 50000:50000 -v /var/jenkins_home:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):/usr/bin/docker --name jenkinsmaster jenkins/jenkins:lts

3.安装Jenkins插件:Docker Pipeline

4.创建job配置pipline:

pipeline {
    agent {
        docker { image 'node:7-alpine' }
    }
    stages {
        stage('Test') {
            steps {
                sh 'node --version'
            }
        }
    }
}

posted on 2020-11-23 17:13  老吃鸡  阅读(144)  评论(0编辑  收藏  举报

导航