docker 版 jenkins运行

时间:2019-07-22 20:15:16   收藏:0   阅读:83

直接通过 docker命令运行:

docker run -d -p 31980:8080 -p 31900:50000 -v /docker-image-slave-registry/image/registry2/jenkins:/var/jenkins_home  -v /etc/localtime:/etc/localtime   --privileged=true  jenkins

通过marathon运行(有目前问题)

{
  "id": "jenkins",
  "cmd": null,
  "cpus": 1,
  "mem": 256,
  "disk": 0,
  "instances": 1,
  "container": {
    "docker": {
      "image": "jenkins", 
      "privileged": true,
      "forcePullImage": false
    },
    "type": "DOCKER",
    "portMappings": [
      {
        "containerPort": 50000,
                "hostPort": 31900,
                "servicePort": 0,
        "protocol": "tcp",
        "name": "jenkins50000",
        "labels": null
      },
      {
        "containerPort": 8080,
                "hostPort": 31980,
                "servicePort": 0,
        "protocol": "tcp",
        "name": "jenkins8080",
        "labels": null
      }
    ],
    "volumes": [
        {
        "containerPath": "/var/jenkins_home",
        "mode": "RW",
                "hostPath": "/docker-image-slave-registry/image/registry2/jenkins" 
    },{
        "containerPath": "/etc/localtime",
        "mode": "RW",
                "hostPath": "/etc/localtime" 
    }]
  },
  "networks": [
    {
      "mode": "container/bridge"
    }
  ],
  "env": {},
  "labels": {},
  "constraints": [["hostname", "CLUSTER", "192.168.1.153"]],
  "healthChecks": []
}

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!