From 504c792861e74842d1dd6e74d8504caa83b18498 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Tue, 5 Mar 2019 10:15:59 -0700 Subject: [PATCH] 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. --- distribution/docker/src/docker/Dockerfile | 2 ++ server/src/main/java/org/elasticsearch/Build.java | 3 +++ 2 files changed, 5 insertions(+) diff --git a/distribution/docker/src/docker/Dockerfile b/distribution/docker/src/docker/Dockerfile index a6d0556a4788e..d7b3b7117fee8 100644 --- a/distribution/docker/src/docker/Dockerfile +++ b/distribution/docker/src/docker/Dockerfile @@ -31,6 +31,8 @@ WORKDIR /usr/share/elasticsearch COPY ${elasticsearch} /opt/ RUN tar zxf /opt/${elasticsearch} --strip-components=1 +RUN grep ES_DISTRIBUTION_TYPE=tar /usr/share/elasticsearch/bin/elasticsearch-env \ + && sed -ie 's/ES_DISTRIBUTION_TYPE=tar/ES_DISTRIBUTION_TYPE=docker/' /usr/share/elasticsearch/bin/elasticsearch-env RUN mkdir -p config data logs RUN chmod 0775 config data logs COPY config/elasticsearch.yml config/log4j2.properties config/ diff --git a/server/src/main/java/org/elasticsearch/Build.java b/server/src/main/java/org/elasticsearch/Build.java index 9e659bb4145bb..dcf827091f54e 100644 --- a/server/src/main/java/org/elasticsearch/Build.java +++ b/server/src/main/java/org/elasticsearch/Build.java @@ -75,6 +75,7 @@ public static Flavor fromDisplayName(final String displayName) { public enum Type { DEB("deb"), + DOCKER("docker"), RPM("rpm"), TAR("tar"), ZIP("zip"), @@ -94,6 +95,8 @@ public static Type fromDisplayName(final String displayName) { switch (displayName) { case "deb": return Type.DEB; + case "docker": + return Type.DOCKER; case "rpm": return Type.RPM; case "tar":