From 2a20179fdd24738035eb7cad70f7d7f2ae631bd0 Mon Sep 17 00:00:00 2001 From: gjmzj Date: Wed, 5 Jun 2019 23:43:09 +0800 Subject: [PATCH] move dockerfiles to github.com/kubeasz/dockerfiles --- dockerfiles/ansible/Dockerfile | 29 ---------------- dockerfiles/es-index-rotator/Dockerfile | 17 ---------- dockerfiles/es-index-rotator/rotate.sh | 44 ------------------------- dockerfiles/kubeasz/Dockerfile | 12 ------- dockerfiles/readme.md | 3 ++ 5 files changed, 3 insertions(+), 102 deletions(-) delete mode 100644 dockerfiles/ansible/Dockerfile delete mode 100644 dockerfiles/es-index-rotator/Dockerfile delete mode 100755 dockerfiles/es-index-rotator/rotate.sh delete mode 100644 dockerfiles/kubeasz/Dockerfile create mode 100644 dockerfiles/readme.md diff --git a/dockerfiles/ansible/Dockerfile b/dockerfiles/ansible/Dockerfile deleted file mode 100644 index fbf468e..0000000 --- a/dockerfiles/ansible/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -# Dockerfile for building Ansible image for Alpine 3 -# Origin from https://github.com/William-Yeh/docker-ansible - -FROM alpine:3.8 - -RUN \ - echo "===> Adding Python runtime..." && \ - apk --update add python py-pip openssl ca-certificates && \ - apk --update add --virtual build-dependencies \ - python-dev libffi-dev openssl-dev build-base && \ - pip install --upgrade pip cffi && \ - \ - \ - echo "===> Installing Ansible..." && \ - pip install ansible==2.6.12 && \ - \ - \ - echo "===> Installing handy tools..." && \ - pip install --upgrade pycrypto && \ - apk --update add bash openssh-client rsync && \ - \ - \ - echo "===> Removing package list..." && \ - apk del build-dependencies && \ - rm -rf /var/cache/apk/* && \ - rm -rf /root/.cache - -# default command: display Ansible version -CMD [ "ansible", "--version" ] diff --git a/dockerfiles/es-index-rotator/Dockerfile b/dockerfiles/es-index-rotator/Dockerfile deleted file mode 100644 index 532548a..0000000 --- a/dockerfiles/es-index-rotator/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -# Dockerfile for Rotating the indices in elastic of the EFK deployment -# -# @author: gjmzj -# @repo: https://github.com/kubeasz/mirrorepo/es-index-rotator -# @ref: https://github.com/easzlab/kubeasz/tree/master/dockerfiles/es-index-rotator - -FROM alpine:3.8 - -COPY rotate.sh /bin/rotate.sh - -RUN echo "===> Installing essential tools..." && \ - apk --update add bash curl coreutils && \ - echo "===> Cleaning up cache..." && \ - rm -rf /var/cache/apk/* && \ - chmod +x /bin/rotate.sh - -CMD ["/bin/rotate.sh"] diff --git a/dockerfiles/es-index-rotator/rotate.sh b/dockerfiles/es-index-rotator/rotate.sh deleted file mode 100755 index 510d656..0000000 --- a/dockerfiles/es-index-rotator/rotate.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -#-------------------------------------------------- -# Rotate the indices in elastic of the EFK deployment -# -# @author: gjmzj -# @usage: ./rotate.sh [num_of_days] (1 /tmp/indices || \ -{ echo "[ERROR] Can not connect to elastic!"; exit 1; } - -curr_days_of_log=$(cat /tmp/indices|grep logstash|wc -l) - -curr_days_of_log=$((${curr_days_of_log}-2)) - -if [[ "$max_days_of_log" -gt "$curr_days_of_log" ]];then - echo "[WARN] No need to rotate the ES indices!" - exit 0 -fi - -first_day=$(date -d "$max_days_of_log days ago" +'%Y.%m.%d') - -rotate=$(cat /tmp/indices|grep logstash|cut -d' ' -f3|cut -d'-' -f2|sort|sed -n "1,/$first_day/"p) - -for day in $rotate;do - curl -X DELETE elasticsearch-logging:9200/logstash-$day -done - -echo -e "\n[INFO] Success to rotate the ES indices!" -exit 0 diff --git a/dockerfiles/kubeasz/Dockerfile b/dockerfiles/kubeasz/Dockerfile deleted file mode 100644 index 7ace764..0000000 --- a/dockerfiles/kubeasz/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -# NOTE: Prepare following Requirements and Build the image "kubeasz:$TAG" -# Requirement 1: git clone --depth=1 https://github.com/easzlab/kubeasz.git -# Requirement 2: download binaries at https://pan.baidu.com/s/1c4RFaA, and put into dir 'kubeasz/bin' -# Build: docker build -t kubeasz:$TAG . - -FROM jmgao1983/ansible:v2.6 - -COPY kubeasz/ /etc/ansible - -RUN ln -s /etc/ansible/tools/easzctl /usr/bin/easzctl - -CMD [ "sleep", "360000000" ] diff --git a/dockerfiles/readme.md b/dockerfiles/readme.md new file mode 100644 index 0000000..2730edf --- /dev/null +++ b/dockerfiles/readme.md @@ -0,0 +1,3 @@ +# Dockerfiles for building images needed + +Please refer to https://github.com/kubeasz/dockerfiles