-
Notifications
You must be signed in to change notification settings - Fork 24.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
170 additions
and
44 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
27 changes: 27 additions & 0 deletions
27
...asticsearch/gradle/internal/distribution/DockerWolfiEssElasticsearchDistributionType.java
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,27 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the "Elastic License | ||
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
* Public License v 1"; you may not use this file except in compliance with, at | ||
* your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
package org.elasticsearch.gradle.internal.distribution; | ||
|
||
import org.elasticsearch.gradle.ElasticsearchDistributionType; | ||
|
||
public class DockerWolfiEssElasticsearchDistributionType implements ElasticsearchDistributionType { | ||
|
||
DockerWolfiEssElasticsearchDistributionType() {} | ||
|
||
@Override | ||
public String getName() { | ||
return "dockerWolfiEss"; | ||
} | ||
|
||
@Override | ||
public boolean isDocker() { | ||
return true; | ||
} | ||
} |
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
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
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
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
This file was deleted.
Oops, something went wrong.
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,52 @@ | ||
FROM ${base_image} AS builder | ||
|
||
USER root | ||
|
||
<% if (docker_base == "wolfi_ess") { %> | ||
# Add plugins infrastructure | ||
RUN mkdir -p /opt/plugins/archive | ||
RUN chmod -R 0555 /opt/plugins | ||
|
||
COPY filebeat-${version}.tar.gz metricbeat-${version}.tar.gz /tmp/ | ||
RUN set -eux ; \\ | ||
for beat in filebeat metricbeat ; do \\ | ||
if [ ! -s /tmp/\$beat-${version}.tar.gz ]; then \\ | ||
echo "/tmp/\$beat-${version}.tar.gz is empty - cannot uncompress" 2>&1 ; \\ | ||
exit 1 ; \\ | ||
fi ; \\ | ||
if ! tar tf /tmp/\$beat-${version}.tar.gz >/dev/null; then \\ | ||
echo "/tmp/\$beat-${version}.tar.gz is corrupt - cannot uncompress" 2>&1 ; \\ | ||
exit 1 ; \\ | ||
fi ; \\ | ||
mkdir -p /opt/\$beat ; \\ | ||
tar xf /tmp/\$beat-${version}.tar.gz -C /opt/\$beat --strip-components=1 ; \\ | ||
done | ||
<% } %> | ||
|
||
COPY plugins/*.zip /opt/plugins/archive/ | ||
|
||
RUN chown root.root /opt/plugins/archive/* | ||
RUN chmod 0444 /opt/plugins/archive/* | ||
|
||
FROM ${base_image} | ||
RUN echo "${docker_base}" | ||
<% if (docker_base == "wolfi_ess") { %> | ||
USER root | ||
|
||
RUN <%= retry.loop("apk", "export DEBIAN_FRONTEND=noninteractive && apk update && apk update && apk add --no-cache wget") %> | ||
|
||
# tweak entry point for ESS specific wolfi image | ||
ENTRYPOINT ["/sbin/tini", "--"] | ||
CMD ["/app/elasticsearch.sh"] | ||
# Generate a stub command that will be overwritten at runtime | ||
RUN mkdir /app && \\ | ||
echo -e '#!/bin/bash\\nexec /usr/local/bin/docker-entrypoint.sh eswrapper' > /app/elasticsearch.sh && \\ | ||
chmod 0555 /app/elasticsearch.sh | ||
|
||
COPY --from=builder --chown=0:0 /opt /opt | ||
USER 1000:0 | ||
<% } else { %> | ||
COPY --from=builder /opt/plugins /opt/plugins | ||
<% } %> | ||
|
||
ENV ES_PLUGIN_ARCHIVE_DIR /opt/plugins/archive |
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
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