Presentation is loading. Please wait.

Presentation is loading. Please wait.

1© Copyright 2015 EMC Corporation. All rights reserved. COPRHD ON DOCKER YUN QIN, COPRHD DEVCON.

Similar presentations


Presentation on theme: "1© Copyright 2015 EMC Corporation. All rights reserved. COPRHD ON DOCKER YUN QIN, COPRHD DEVCON."— Presentation transcript:

1 1© Copyright 2015 EMC Corporation. All rights reserved. COPRHD ON DOCKER YUN QIN, COPRHD DEVCON

2 2© Copyright 2015 EMC Corporation. All rights reserved. Building the CoprHD docker image Deploying the CoprHD docker image Demo Q & A AGENDA

3 3© Copyright 2015 EMC Corporation. All rights reserved. Contents – Opensuse base w/ required libraries (runtime) – CoprHD rpm How to build – Run “ make BUILD_TYPE=oss docker ” Outcome – A docker image: “coprhd-devkit” BUILDING THE IMAGE

4 4© Copyright 2015 EMC Corporation. All rights reserved. FROM opensuse:13.2 RUN zypper --non-interactive install keepalived wget openssh-fips telnet aaa_base arping2 python python-base mozilla-nss sudo ipcalc java-1_7_0-openjdk RUN zypper --non-interactive install --no-recommends patch gcc-c++ pcre-devel libopenssl-devel tar make ADD http://download.opensuse.org/repositories/home:/seife:/testing/openSUSE_13.2/x86_64/sipcalc-1.1.6-5.1.x86_64.rpm / RUN rpm -Uvh --nodeps sipcalc-1.1.6-5.1.x86_64.rpm && rm -f sipcalc-1.1.6-5.1.x86_64.rpm RUN groupadd storageos && useradd -d /opt/storageos -g storageos storageos RUN groupadd svcuser && useradd -g svcuser svcuser RUN wget http://nginx.org/download/nginx-1.6.2.tar.gz && \ wget --no-check-certificate https://github.com/yaoweibin/nginx_upstream_check_module/archive/v0.3.0.tar.gz && \ wget --no-check-certificate https://github.com/openresty/headers-more-nginx-module/archive/v0.25.tar.gz && \ tar xvzf nginx-1.6.2.tar.gz && tar xvzf v0.3.0.tar.gz && tar xvzf v0.25.tar.gz && \ cd nginx-1.6.2 && patch -p1 <../nginx_upstream_check_module-0.3.0/check_1.5.12+.patch && \./configure --add-module=../nginx_upstream_check_module-0.3.0 --add-module=../headers-more-nginx-module-0.25 --with- http_ssl_module --prefix=/usr --conf-path=/etc/nginx/nginx.conf && \ make && make install && cd.. && \ rm -f nginx-1.6.2.tar.gz v0.3.0.tar.gz v0.25.tar.gz && \ rm -rf nginx-1.6.2 nginx_upstream_check_module-0.3.0 headers-more-nginx-module-0.25 ADD storageos-*.x86_64.rpm / RUN DO_NOT_START="yes" rpm -iv storageos-*.x86_64.rpm && rm -f /storageos-*.x86_64.rpm RUN ln -s /coprhd/ovfenv.properties /etc CMD ["/sbin/init”] DOCKERFILE Base image Required libraries Users/groups Customized nginx Installing CoprHD rpm Hook for ovfenv.properties To start systemd

5 5© Copyright 2015 EMC Corporation. All rights reserved. Same image, multiple deployment types Problems to solve – Static IP – Accessing the internal IPs from outside (NAT) DEPLOYING THE IMAGE

6 6© Copyright 2015 EMC Corporation. All rights reserved. CoprHD needs it, but docker doesn’t Docker provides a way and a future plan (libnetwork)waylibnetwork For now we use pipeworkpipework STATIC IP

7 7© Copyright 2015 EMC Corporation. All rights reserved. STATIC IP (CONT’D) Docker host eth0 veth container eth0 docker0 to other ports to port 443/4443 to port 443/4443 NAT rules

8 8© Copyright 2015 EMC Corporation. All rights reserved. ovfenv.properties – Contains IP/host configs – Needed for deploying CoprHD ViPR: part of the vApp settings CoprHD: plain text file CoprHD on docker: provided from host via an external volume OVFENV.PROPERTIES

9 9© Copyright 2015 EMC Corporation. All rights reserved. NAT Docker host Container1 172.17.0.1 172.17.0.4(VIP) Container1 172.17.0.1 172.17.0.4(VIP) Container2 172.17.0.2 Container2 172.17.0.2 Container3 172.17.0.3 Container3 172.17.0.3 eth0 tcp 443/4443 to 172.17.0.4:443/4443 tcp 443/4443 to 172.17.0.4:443/4443

10 10© Copyright 2015 EMC Corporation. All rights reserved. VIPR1_ADDR=172.17.0.1 GATEWAY=172.17.42.1 VIP=172.17.0.2 HOSTNAME=vipr1 NETMASK_BITS=16 DATA_DIR=${PWD}/vipr1 SETUP_DIR=${PWD}/data echo -e network_gateway=${GATEWAY}'\n'network_netmask=255.255.0.0'\n'network_prefix_length=64'\n'network_1_ipaddr =${VIPR1_ADDR}'\n'network_vip=${VIP}'\n'network_gateway6=::0'\n'network_1_ipaddr6=::0'\n'network_vip6=::0'\ n'node_count=1'\n'node_id=${HOSTNAME} > ${SETUP_DIR}/ovfenv.properties CONTAINER_ID=$(docker run --net=none -ti --privileged -v ${SETUP_DIR}:/coprhd:ro -v ${DATA_DIR}:/data:rw -d coprhd-devkit) pipework docker0 -i eth0 ${CONTAINER_ID} ${VIPR1_ADDR}/${NETMASK_BITS}@${GATEWAY} docker exec -it ${CONTAINER_ID} hostname ${HOSTNAME} docker exec -it ${CONTAINER_ID} /bin/bash -c "echo ${VIPR1_ADDR} ${HOSTNAME} >> /etc/hosts” iptables -t nat -A DOCKER -p tcp --dport 443 -j DNAT --to-destination ${VIP}:443 iptables -t nat -A DOCKER -p tcp --dport 4443 -j DNAT --to-destination ${VIP}:4443 DEPLOYMENT SCRIPT Creating ovfenv.properties Creating the container w/o network Configuring network Configuring NAT

11 11© Copyright 2015 EMC Corporation. All rights reserved. DEMO

12 12© Copyright 2015 EMC Corporation. All rights reserved. Trim the size of the image (now 900M) Update the deploy script w/ the docker network command Build the CoprHD rpm inside the build container Publish the docker image on docker hub, perhaps as an automated build repo FUTURE WORK

13


Download ppt "1© Copyright 2015 EMC Corporation. All rights reserved. COPRHD ON DOCKER YUN QIN, COPRHD DEVCON."

Similar presentations


Ads by Google