1. docker pull jenkins
2. docker run -d -p
49001
:
8080
-v $PWD/jenkins:/var/jenkins_home:z -t jenkins
如果要设置nginx做反代,可以
upstream app { server 127.0 . 0.1 : 49001 ; } server { listen 80 ; server_name jenkins.your-domain.com; location / { proxy_pass http: //app; } } |
如果遇到启动错误,可能是目录权限设置导致的,解决方法如下:
1.
chcon -Rt svirt_sandbox_file_t /path/to/volume
2. chown 1000 volume_dir