-
Notifications
You must be signed in to change notification settings - Fork 1
/
HEAT-DOCKER
35 lines (23 loc) · 1.23 KB
/
HEAT-DOCKER
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
http://download.opensuse.org/repositories/Cloud:/OpenStack:/Juno/SLE_11_SP3/x86_64/
安装heat-docker:
# sh install.sh
查看是否安装成功:
# heat resource-type-list | grep Docker
如果返回DockerInc::Docker::Container,则说明安装成功。
#!/bin/bash
rpm -ivh openstack-heat-plugin-heat_docker-2014.2.4.dev8-1.1.x86_64.rpm python-docker-py-0.5.3-2.3.x86_64.rpm python-websocket-client-0.23.0-2.3.x86_64.rpm --nodeps --force
heatControl -A RESTART
#!/bin/bash
RegistryAddr="186.100.40.82:5000"
rpm -ivh /home/docker-1.6.x86_64.rpm
sed -i "s/OPTIONS='--selinux-enabled'/OPTIONS='-H tcp:\/\/0.0.0.0:2375 -H unix:\/\/\/var\/run\/docker.sock --selinux-enabled'/g" /etc/sysconfig/docker
sed -i "s/# INSECURE_REGISTRY='--insecure-registry '/INSECURE_REGISTRY='--insecure-registry $RegistryAddr'/g" /etc/sysconfig/docker
systemctl enable docker
systemctl restart docker
container.yml为启动容器的模板,命令格式如下:
heat stack-create -f container.yml container_docker_nginx -P "endpoint=http://172.28.12.2:2375;image_name=nginx;container_name=c1;port_bind={\"80\":\"9008\"}"
需指定如下参数:
endpoint:docker deamon服务访问点
image_name: 镜像名称
container_name:容器名称
port_bind:端口映射