Skip to content

Commit 7f2e177

Browse files
authored
Add Docker build type (#39378)
This commit adds a new build type (together with deb/rpm/tar/zip) to represent the official Docker images. This build type will be displayed in APIs such as the main and nodes info APIs.
1 parent 80a109b commit 7f2e177

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

distribution/docker/src/docker/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ WORKDIR /usr/share/elasticsearch
3131
${source_elasticsearch}
3232

3333
RUN tar zxf /opt/${elasticsearch} --strip-components=1
34+
RUN grep ES_DISTRIBUTION_TYPE=tar /usr/share/elasticsearch/bin/elasticsearch-env \
35+
&& sed -ie 's/ES_DISTRIBUTION_TYPE=tar/ES_DISTRIBUTION_TYPE=docker/' /usr/share/elasticsearch/bin/elasticsearch-env
3436
RUN mkdir -p config data logs
3537
RUN chmod 0775 config data logs
3638
COPY config/elasticsearch.yml config/log4j2.properties config/

server/src/main/java/org/elasticsearch/Build.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public static Flavor fromDisplayName(final String displayName) {
7575
public enum Type {
7676

7777
DEB("deb"),
78+
DOCKER("docker"),
7879
RPM("rpm"),
7980
TAR("tar"),
8081
ZIP("zip"),
@@ -94,6 +95,8 @@ public static Type fromDisplayName(final String displayName) {
9495
switch (displayName) {
9596
case "deb":
9697
return Type.DEB;
98+
case "docker":
99+
return Type.DOCKER;
97100
case "rpm":
98101
return Type.RPM;
99102
case "tar":

0 commit comments

Comments
 (0)