From 92c35ed94624553136630ce04abd78b60cd0eb7c Mon Sep 17 00:00:00 2001 From: Aiko Mastboom Date: Tue, 17 Mar 2015 21:17:28 +0100 Subject: [PATCH] boot2docker start --- mywiki/tiddlers/boot2docker brew.tid | 20 +++++++ mywiki/tiddlers/boot2docker dmg.tid | 9 +++ mywiki/tiddlers/bootstrap deploy2docker.tid | 63 +++++++++++++++++++++ 3 files changed, 92 insertions(+) create mode 100644 mywiki/tiddlers/boot2docker brew.tid create mode 100644 mywiki/tiddlers/boot2docker dmg.tid create mode 100644 mywiki/tiddlers/bootstrap deploy2docker.tid diff --git a/mywiki/tiddlers/boot2docker brew.tid b/mywiki/tiddlers/boot2docker brew.tid new file mode 100644 index 0000000..504b400 --- /dev/null +++ b/mywiki/tiddlers/boot2docker brew.tid @@ -0,0 +1,20 @@ +created: 20150317122424058 +creator: user +modified: 20150317163202110 +modifier: user +tags: +title: boot2docker brew +type: text/vnd.tiddlywiki + +Install Virtualbox + +* https://www.virtualbox.org/wiki/Downloads + +Install Homebrew + +``` +ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +brew update +brew install boot2docker +``` + diff --git a/mywiki/tiddlers/boot2docker dmg.tid b/mywiki/tiddlers/boot2docker dmg.tid new file mode 100644 index 0000000..e6dd527 --- /dev/null +++ b/mywiki/tiddlers/boot2docker dmg.tid @@ -0,0 +1,9 @@ +created: 20150317162950327 +creator: user +modified: 20150317163042312 +modifier: user +tags: +title: boot2docker dmg +type: text/vnd.tiddlywiki + +* http://boot2docker.io \ No newline at end of file diff --git a/mywiki/tiddlers/bootstrap deploy2docker.tid b/mywiki/tiddlers/bootstrap deploy2docker.tid new file mode 100644 index 0000000..2e793e4 --- /dev/null +++ b/mywiki/tiddlers/bootstrap deploy2docker.tid @@ -0,0 +1,63 @@ +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 +```