Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
SPINSYS\rstevens committed Mar 3, 2024
0 parents commit 0a985c3
Show file tree
Hide file tree
Showing 292 changed files with 8,709 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# You can add one username per supported platform and one custom link
patreon: blacktop_
23 changes: 23 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
time: "08:00"
labels:
- "dependencies"
commit-message:
prefix: "feat"
include: "scope"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"
time: "08:00"
labels:
- "dependencies"
commit-message:
prefix: "feat"
include: "scope"
138 changes: 138 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Publish Docker Image

on:
push:
branches:
- '**'

jobs:
push_to_registries:
name: Push Docker image to multiple registries
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
-
name: Check out the repo
uses: actions/checkout@v3

-
name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: |
blacktop/elasticsearch
ghcr.io/${{ github.repository }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2

-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

-
name: Docker Login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

-
name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image (v1)
id: docker_build_1
uses: docker/build-push-action@v3
timeout-minutes: 20
with:
context: ./1.7
push: ${{ github.event_name != 'pull_request' }}
tags: |
blacktop/elasticsearch:1
blacktop/elasticsearch:1.7
blacktop/elasticsearch:1.7.6
ghcr.io/blacktop/elasticsearch:1
ghcr.io/blacktop/elasticsearch:1.7
ghcr.io/blacktop/elasticsearch:1.7.6
platforms: linux/amd64,linux/arm64
labels: ${{ steps.meta.outputs.labels }}

- name: Build and push Docker image (v6)
id: docker_build_6
uses: docker/build-push-action@v3
timeout-minutes: 20
with:
context: ./6.8
push: ${{ github.event_name != 'pull_request' }}
tags: |
blacktop/elasticsearch:6
blacktop/elasticsearch:6.8
blacktop/elasticsearch:6.8.23
ghcr.io/blacktop/elasticsearch:6
ghcr.io/blacktop/elasticsearch:6.8
ghcr.io/blacktop/elasticsearch:6.8.23
platforms: linux/amd64,linux/arm64
labels: ${{ steps.meta.outputs.labels }}

- name: Build and push Docker image (v7)
id: docker_build_7
uses: docker/build-push-action@v3
timeout-minutes: 20
with:
context: ./7.17
push: ${{ github.event_name != 'pull_request' }}
tags: |
blacktop/elasticsearch:7
blacktop/elasticsearch:7.17
blacktop/elasticsearch:7.17.2
ghcr.io/blacktop/elasticsearch:7
ghcr.io/blacktop/elasticsearch:7.17
ghcr.io/blacktop/elasticsearch:7.17.2
platforms: linux/amd64,linux/arm64
labels: ${{ steps.meta.outputs.labels }}

- name: Build and push Docker image (v8)
id: docker_build_8
uses: docker/build-push-action@v3
timeout-minutes: 20
with:
context: ./8.1
push: ${{ github.event_name != 'pull_request' }}
tags: |
blacktop/elasticsearch:latest
blacktop/elasticsearch:8
blacktop/elasticsearch:8.1
blacktop/elasticsearch:8.1.2
ghcr.io/blacktop/elasticsearch:latest
ghcr.io/blacktop/elasticsearch:8
ghcr.io/blacktop/elasticsearch:8.1
ghcr.io/blacktop/elasticsearch:8.1.2
platforms: linux/amd64,linux/arm64
labels: ${{ steps.meta.outputs.labels }}

# - name: Build and push Docker image (X-Pack)
# id: docker_build_x_pack
# uses: docker/build-push-action@v3
# with:
# context: ./x-pack
# push: ${{ github.event_name != 'pull_request' }}
# tags: |
# blacktop/elasticsearch:x-pack
# blacktop/elasticsearch:x-pack-7
# blacktop/elasticsearch:x-pack-7.15
# blacktop/elasticsearch:x-pack-7.15.1
# labels: ${{ steps.meta.outputs.labels }}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
build
*.tgz
*.bu

.vagrant/
.vscode/settings.json
12 changes: 12 additions & 0 deletions 1.7/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Ignore .git folder
.git*
.gitignore

es-logo.png
LICENSE
README.md
docker-compose.yml
.DS_Store
build
release
Makefile
41 changes: 41 additions & 0 deletions 1.7/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM alpine:3.14

MAINTAINER blacktop, https://github.com/blacktop

RUN apk add --no-cache openjdk8-jre-base tini su-exec

ENV ELASTIC 1.7.6

RUN apk add --no-cache -t build-deps wget ca-certificates \
&& cd /tmp \
&& wget -O elasticsearch-$ELASTIC.tar.gz https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-$ELASTIC.tar.gz \
&& tar -xzf elasticsearch-$ELASTIC.tar.gz \
&& mv elasticsearch-$ELASTIC /usr/share/elasticsearch \
&& adduser -DH -s /sbin/nologin elasticsearch \
&& echo "Creating Elasticsearch Paths..." \
&& for path in \
/usr/share/elasticsearch/data \
/usr/share/elasticsearch/logs \
/usr/share/elasticsearch/config \
/usr/share/elasticsearch/config/scripts \
/usr/share/elasticsearch/plugins \
; do \
mkdir -p "$path"; \
done \
&& chown -R elasticsearch:elasticsearch /usr/share/elasticsearch \
&& rm -rf /tmp/* \
&& apk del --purge build-deps

COPY config/elastic /usr/share/elasticsearch/config
COPY config/logrotate /etc/logrotate.d/elasticsearch
COPY elastic-entrypoint.sh /

ENV PATH /usr/share/elasticsearch/bin:$PATH

VOLUME ["/usr/share/elasticsearch/data"]

EXPOSE 9200 9300

ENTRYPOINT ["/elastic-entrypoint.sh"]

CMD ["elasticsearch"]
1 change: 1 addition & 0 deletions 1.7/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.7
6 changes: 6 additions & 0 deletions 1.7/config/elastic/elasticsearch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
network.host: 0.0.0.0

# this value is required because we set "network.host"
# be sure to modify it appropriately for a production cluster deployment
discovery.zen.minimum_master_nodes: 1
bootstrap.ignore_system_bootstrap_checks: true
15 changes: 15 additions & 0 deletions 1.7/config/elastic/logging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# you can override this using by setting a system property, for example -Des.logger.level=DEBUG
es.logger.level: INFO
rootLogger: ${es.logger.level}, console
logger:
# log action execution errors for easier debugging
action: DEBUG
# reduce the logging for aws, too much is logged under the default INFO
com.amazonaws: WARN

appender:
console:
type: console
layout:
type: consolePattern
conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"
11 changes: 11 additions & 0 deletions 1.7/config/logrotate
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/var/log/elasticsearch/*.log {
daily
rotate 50
size 50M
copytruncate
compress
delaycompress
missingok
notifempty
create 644 elasticsearch elasticsearch
}
78 changes: 78 additions & 0 deletions 1.7/elastic-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#!/bin/sh

set -e

# Add elasticsearch as command if needed
if [ "${1:0:1}" = '-' ]; then
set -- elasticsearch "$@"
fi

# Drop root privileges if we are running elasticsearch
# allow the container to be started with `--user`
if [ "$1" = 'elasticsearch' -a "$(id -u)" = '0' ]; then
# Change the ownership of /usr/share/elasticsearch/data to elasticsearch
chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data

set -- su-exec elasticsearch tini -- "$@"
#exec su-exec elasticsearch "$BASH_SOURCE" "$@"
fi

if [ "$1" = 'kopf' -a "$(id -u)" = '0' ]; then
# Install kopf plugin
plugin install lmenezes/elasticsearch-kopf/v2.1.1

# Change the ownership of /usr/share/elasticsearch/data to elasticsearch
chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data

set -- su-exec elasticsearch tini -- elasticsearch
#exec su-exec elasticsearch "$BASH_SOURCE" "$@"
fi

if [ "$1" = 'master' -a "$(id -u)" = '0' ]; then
# Change node into a master node
echo "node.master: true" >> /usr/share/elasticsearch/config/elasticsearch.yml
echo "node.client: false" >> /usr/share/elasticsearch/config/elasticsearch.yml
echo "node.data: false" >> /usr/share/elasticsearch/config/elasticsearch.yml

# Change the ownership of /usr/share/elasticsearch/data to elasticsearch
chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data

set -- su-exec elasticsearch tini -- elasticsearch
#exec su-exec elasticsearch "$BASH_SOURCE" "$@"
fi

if [ "$1" = 'client' -a "$(id -u)" = '0' ]; then
# Change node into a client node
echo "node.master: false" >> /usr/share/elasticsearch/config/elasticsearch.yml
echo "node.client: true" >> /usr/share/elasticsearch/config/elasticsearch.yml
echo "node.data: false" >> /usr/share/elasticsearch/config/elasticsearch.yml
echo "discovery.zen.ping.unicast.hosts: [\"elastic-master\"]" >> /usr/share/elasticsearch/config/elasticsearch.yml

# Install kopf plugin
plugin install lmenezes/elasticsearch-kopf/v2.1.1

# Change the ownership of /usr/share/elasticsearch/data to elasticsearch
chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data

set -- su-exec elasticsearch tini -- elasticsearch
#exec su-exec elasticsearch "$BASH_SOURCE" "$@"
fi

if [ "$1" = 'data' -a "$(id -u)" = '0' ]; then
# Change node into a data node
echo "node.master: false" >> /usr/share/elasticsearch/config/elasticsearch.yml
echo "node.client: false" >> /usr/share/elasticsearch/config/elasticsearch.yml
echo "node.data: true" >> /usr/share/elasticsearch/config/elasticsearch.yml
echo "discovery.zen.ping.unicast.hosts: [\"elastic-master\"]" >> /usr/share/elasticsearch/config/elasticsearch.yml

# Change the ownership of /usr/share/elasticsearch/data to elasticsearch
chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data

set -- su-exec elasticsearch tini -- elasticsearch
#exec su-exec elasticsearch "$BASH_SOURCE" "$@"
fi

# As argument is not related to elasticsearch,
# then assume that user wants to run his own process,
# for example a `bash` shell to explore this image
exec "$@"
12 changes: 12 additions & 0 deletions 2.3/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Ignore .git folder
.git*
.gitignore

es-logo.png
LICENSE
README.md
docker-compose.yml
.DS_Store
build
release
Makefile
Loading

0 comments on commit 0a985c3

Please sign in to comment.