comeonzz 2015-05-04
下一代云计算平台Apache Mesos定制自己的PaaS-1(Apache Mesos安装部署)
下一代云计算平台Apache Mesos定制自己的PaaS-2(使用marathon发布管理应用)
下一代云计算平台Apache Mesos定制自己的PaaS-3(docker应用发布)
下一代云计算平台Apache Mesos定制自己的PaaS-4(使用haproxy-marathon-proxy实现服务发现和负载均衡)
下一代云计算平台Apache Mesos定制自己的PaaS-5(使用bamboo实现服务发现和负载均衡)
docker pull docker-registry docker run -t -p 5000:5000 docker-registry
docker pull consol/tomcat-8.0 docker tag consol/tomcat-8.0 192.168.1.103:5000/tomcat docker push 192.168.1.103:5000/tomcat
vi /usr/lib/systemd/system/docker.service
修改如下:即在/usr/bin/docker -d
后增加--insecure-registry 192.168.1.103:5000
[Unit] Description=Docker Application Container Engine Documentation=http://docs.docker.com After=network.target [Service] Type=notify EnvironmentFile=-/etc/sysconfig/docker EnvironmentFile=-/etc/sysconfig/docker-storage EnvironmentFile=-/etc/sysconfig/docker-network ExecStart=/usr/bin/docker -d --insecure-registry 192.168.1.103:5000 $OPTIONS \ $DOCKER_STORAGE_OPTIONS \ $DOCKER_NETWORK_OPTIONS \ $ADD_REGISTRY \ $BLOCK_REGISTRY \ $INSECURE_REGISTRY LimitNOFILE=1048576 LimitNPROC=1048576 LimitCORE=infinity MountFlags=slave [Install] WantedBy=multi-user.target
所有的mesos slave机器:
echo 'docker,mesos' > /etc/mesos-slave/containerizers echo '5mins' > /etc/mesos-slave/executor_registration_timeout systemctl restart mesos-slave
{ "container": { "type": "DOCKER", "docker": { "image": "192.168.1.103:5000/tomcat", "network": "BRIDGE", "portMappings": [ { "containerPort": 8080, "hostPort": 0, "protocol": "tcp" } ] } }, "id": "tomcat", "instances": 3, "cpus": 0.5, "mem": 512, "uris": [], "cmd":"/opt/tomcat/bin/deploy-and-run.sh" }
curl -X POST -H "Content-Type: application/json" http://192.168.1.110:8080/v2/apps [email protected]
本例发布了2个docker images,另外是一个spring boot的可执行jar包。