created: 20150317163014131 creator: user modified: 20150317174300850 modifier: user tags: title: bootstrap deploy2docker type: text/vnd.tiddlywiki ! Install [[boot2docker brew]] or [[boot2docker dmg]] ```bash boot2docker run $(boot2docker shellinit) ``` ! Clone cxp-ops repo ```bash hg clone ssh://hg@git.informaat.com/projects/cxp-ops cd cxp-ops ``` ! Build ops_bootstrap image ```bash docker build -t cxp-ops/ops_bootstrap . ``` You now have an image that is able to run the correct version of ansible. ! Building the base_image Start the ops_bootstrap image and make sure it has access to your certificates and cxp-ops folder. ```bash docker run --rm -it -v ${DOCKER_CERT_PATH}:/certs -v $(pwd):/root/ops cxp-ops/ops_bootstrap bash ``` Running `docker ps` inside the container should work. (if you run into version problems the Dockerfile for the ops_bootstrap needs updating and the bootstrap begins again with the ''Build ops_bootstrap image'' step. Build the base_image: ```bash cd /root/ops/docker/silo docker build -t cxp-ops/base_image . ``` ! Adding the opscentre to the base_image In order for ansible to connect to your base_image a container needs to be started with an ssh server inside it. ```bash cd /root/ops ./ninja_create my_docker_opscenctre ``` This creates a docker container and installs the opscentre in it. ```bash CID=$(docker ps | grep base_image | cut -d ' ' -f 1) docker commit -m "initial commit" ${CID} cxp-ops/opscentre ```