1
0
mirror of /repos/dotTiddlywiki.git synced 2025-12-30 07:31:33 +01:00
dotTiddlywiki/mywiki/tiddlers/bootstrap deploy2docker.tid
2015-05-04 16:39:09 +02:00

66 lines
1.5 KiB
Plaintext

created: 20150317163014131
creator: user
modified: 20150422120349906
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 -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 ./hosts/my_docker_opscenctre.informaat.net.json
./ninja_install ./hosts/my_docker_opscenctre.informaat.net.json
```
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
```