【全栈之路】docker安装jenkins最新版本 2.204.2

使用镜像安装,记得不要选错,这个里面才是最新的,不然插件安装不上

docker pull jenkins/jenkins:lts

下载成功以后

执行安装步骤

docker run -p 28080:8080 -p 50000:50000 -d  -v /Users/zhaohaiyuan/Downloads/docker/jenkins:/var/jenkins_home --name myjenkins jenkins/jenkins:lts

运行成功以后执行

docker exec -it 7f485bd95c3b  /bin/bash 进入jenkins容器

找到安装密钥

cat /var/jenkins_home/secrets/initialAdminPassword

然后下一步下一步的安装,运行成功后记得查看版本

docker inspect 容器id


"StdinOnce": false,
            "Env": [
                "PATH=/usr/local/openjdk-8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "LANG=C.UTF-8",
                "JAVA_HOME=/usr/local/openjdk-8",
                "JAVA_VERSION=8u242",
                "JAVA_BASE_URL=https://github.com/AdoptOpenJDK/openjdk8-upstream-binaries/releases/download/jdk8u242-b08/OpenJDK8U-jdk_",
                "JAVA_URL_VERSION=8u242b08",
                "JENKINS_HOME=/var/jenkins_home",
                "JENKINS_SLAVE_AGENT_PORT=50000",
                "REF=/usr/share/jenkins/ref",
                "JENKINS_VERSION=2.204.2",
                "JENKINS_UC=https://updates.jenkins.io",
                "JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental",
                "JENKINS_INCREMENTALS_REPO_MIRROR=https://repo.jenkins-ci.org/incrementals",
                "COPY_REFERENCE_FILE_LOG=/var/jenkins_home/copy_reference_file.log"
            ],
            "Cmd": null,
            "Image": "jenkins/jenkins:lts",
            "Volumes": {
                "/var/jenkins_home": {}
            },

 

你可能感兴趣的:(全栈之路)