Public Repository

Last pushed: 4 months ago
Short Description
Playground image for setting up CIFv3 and linking it to an external ESv5 storage container.
Full Description

Development testing and integration work with external ES container.

Using CIF v3.0.0a20 and Elasticsearch v5.4.

NOTES:
The container must run as a "privileged capable container" (via. --privileged --cap-add=SYS_ADMIN) to setup the CIF processes via systemd on ubuntu16.
Referenced: https://developers.redhat.com/blog/2016/09/13/running-systemd-in-a-non-privileged-container/

Example Docker Commands to start external Elasticsearch and ES-Head Containers:

# https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html
echo "Starting elasticsearch v5.4.0 container..."
docker run -it -d \
--restart=always \
--name es-store \
-m 2g \
-p 9200:9200 -p 9300:9300 \
-e "ES_JAVA_OPTS=-Xms2g -Xmx2g" \
-e "xpack.security.enabled=false" \
-e "http.host=0.0.0.0" \
-e "transport.host=127.0.0.1" \
-e "http.cors.enabled=true" \
-e "http.cors.allow-origin=*" \
-v "$PWD/esdata":/usr/share/elasticsearch/data \
docker.elastic.co/elasticsearch/elasticsearch:5.4.0

# https://github.com/mobz/elasticsearch-head#running-with-built-in-server
echo "Starting elasticsearch-head into the ES5 container..."
docker run -it -d \
-p 9100:9100 \
mobz/elasticsearch-head:5

Example Docker Commands:

CIF_DOCKER_NAME=cifv3-es-local
CIF_ES_STORE_NODE=es-store:9200
DOCKER_LINK_OPTION='--link es-store'
DOCKER_CIF_IMAGE='cifv3-systemd'

# As of CIFv3.0.0a20, systemd starting cif-httpd & cif-router error with:
# "Couldn't add fd to fd store: Operation not permitted"
# So we now added the "--privileged" flag.
C=$(docker run -it -d \
--name $CIF_DOCKER_NAME \
-e "container=docker" \
-e "CIF_ANSIBLE_ES=1" \
-e "CIF_ANSIBLE_ES_NODES=$CIF_ES_STORE_NODE" \
-p 3443:443 -p 35000:5000 \
--privileged \
--cap-add=SYS_ADMIN \
-v /sys/fs/cgroup:/sys/fs/cgroup:ro \
--tmpfs /run --tmpfs /run/lock \
$DOCKER_LINK_OPTION \
$DOCKER_CIF_IMAGE)

echo "Getting a shell into the container..."
echo "Time to: bash easybutton.sh"
docker exec -it $C /bin/bash
Docker Pull Command
Owner
shyanfung

Comments (0)