-
-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): github actions workflow for building elastic docker images
- Loading branch information
1 parent
9273316
commit 9792b2a
Showing
3 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Build Docker Images | ||
on: | ||
push: | ||
paths: | ||
- "images/elasticsearch/**" | ||
- ".github/workflows/**" | ||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
elastic-version: | ||
- "7.17.15" | ||
env: | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
DOCKER_BUILD_PLATFORMS: ${{ vars.DOCKER_BUILD_PLATFORMS }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 100 | ||
- name: "Build elasticsearch@${{ matrix.elastic-version }}" | ||
run: | | ||
cd images/elasticsearch/${{ matrix.elastic-version }} | ||
curl "https://raw.githubusercontent.com/pelias/ci-tools/master/build-docker-images.sh" | bash - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# see: https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html | ||
|
||
# base image | ||
FROM docker.elastic.co/elasticsearch/elasticsearch:7.17.15 | ||
USER root | ||
|
||
# environmental settings | ||
ENV ES_JAVA_OPTS '-Xms512m -Xmx512m' | ||
ENV cluster.name 'pelias-dev' | ||
ENV discovery.type 'single-node' | ||
ENV bootstrap.memory_lock 'true' | ||
RUN echo 'vm.max_map_count=262144' >> /etc/sysctl.conf | ||
|
||
# configure plugins | ||
RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install analysis-icu | ||
RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install repository-s3 --batch | ||
|
||
# elasticsearch config | ||
ADD elasticsearch.yml /usr/share/elasticsearch/config/ | ||
RUN chown elasticsearch:elasticsearch config/elasticsearch.yml | ||
|
||
## set permissions so any user can run elasticsearch | ||
# add read permissions to all files in dir | ||
RUN chmod go+r /usr/share/elasticsearch -R | ||
|
||
# add write permissions to config, log & data dirs | ||
RUN chmod go+w /usr/share/elasticsearch \ | ||
/usr/share/elasticsearch/config \ | ||
/usr/share/elasticsearch/logs \ | ||
/usr/share/elasticsearch/data | ||
|
||
# add list permissions to directories | ||
RUN chmod go+x /usr/share/elasticsearch \ | ||
/usr/share/elasticsearch/config \ | ||
/usr/share/elasticsearch/config/repository-s3 | ||
|
||
# add execute permissions to bins | ||
RUN chmod go+x /usr/share/elasticsearch/bin/* | ||
|
||
# run as elasticsearch user | ||
USER elasticsearch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
bootstrap.memory_lock: true | ||
network.host: 0.0.0.0 | ||
http.port: 9200 | ||
node.master: true | ||
node.data: true | ||
thread_pool: | ||
write: | ||
queue_size: 1000 | ||
indices.query.bool.max_clause_count: 4000 |