We recommend using this image installation, do not use the official website recommended jenkinsci / blueocean mirror, use it to build node procedural problems.
1. The host server jenkins_home Directory Permissions
In order to facilitate the installation of plug-ins, upgrades, migrations, thus mapping out jenkins_home directory
sudo chown -R 1000:1000 /home/docker/jenkins
2. Download and install Mirror
docker run -p 8080:8080 -p 50000:50000 -d -v /home/docker/jenkins:/var/jenkins_home -e JAVA_OPTS=-Duser.timezone=Asia/Shanghai jenkins/jenkins:lts
Description:
- the p-port mapping, for example: Host Server Port: Port container - d if running in the background, do not write the log can be seen running on the console - v is mapped to the host server directory container, if the host server directory data will be copied to the container -e set environment variables, here is used to set the time zone
3. Other steps
Default password, and other steps will be omitted to install the plug.
Installation node tool https://wiki.jenkins.io/display/JENKINS/NodeJS+Plugin
Official website installation method https://jenkins.io/zh/doc/book/installing/