diff --git a/dev-tools/packaging/packages.yml b/dev-tools/packaging/packages.yml index 869a6dc4dcf..41b10744db6 100644 --- a/dev-tools/packaging/packages.yml +++ b/dev-tools/packaging/packages.yml @@ -449,6 +449,16 @@ shared: from: 'arm64v8/centos:7' buildFrom: 'arm64v8/centos:7' + - &cloud_agent_docker_spec + <<: *agent_docker_spec + extra_vars: + image_name: '{{.BeatName}}-cloud' + + - &cloud_agent_docker_arm_spec + <<: *agent_docker_arm_spec + extra_vars: + image_name: '{{.BeatName}}-cloud' + # Deb/RPM spec for community beats. - &deb_rpm_spec <<: *common @@ -998,12 +1008,12 @@ specs: types: [docker] spec: <<: *agent_docker_spec + <<: *cloud_agent_docker_spec <<: *elastic_docker_spec <<: *elastic_license_for_binaries # This image gets a 'complete' variant for synthetics and other large - # packages too big to fit in the main image. In addition, the 'cloud' - # variant for the specific cloud requirements. - variants: ["complete", "cloud"] + # packages too big to fit in the main image. + variants: ["complete"] files: '{{.BeatName}}{{.BinaryExt}}': source: ./build/golang-crossbuild/{{.BeatName}}-{{.GOOS}}-{{.Platform.Arch}}{{.BinaryExt}} @@ -1025,12 +1035,12 @@ specs: types: [docker] spec: <<: *agent_docker_arm_spec + <<: *cloud_agent_docker_arm_spec <<: *elastic_docker_spec <<: *elastic_license_for_binaries # This image gets a 'complete' variant for synthetics and other large - # packages too big to fit in the main image. In addition, the 'cloud' - # variant for the specific cloud requirements. - variants: ["complete", "cloud"] + # packages too big to fit in the main image. + variants: ["complete"] files: '{{.BeatName}}{{.BinaryExt}}': source: ./build/golang-crossbuild/{{.BeatName}}-{{.GOOS}}-{{.Platform.Arch}}{{.BinaryExt}} diff --git a/dev-tools/packaging/templates/docker/Dockerfile.elastic-agent.tmpl b/dev-tools/packaging/templates/docker/Dockerfile.elastic-agent.tmpl index fc57f0f7b46..12a86495339 100644 --- a/dev-tools/packaging/templates/docker/Dockerfile.elastic-agent.tmpl +++ b/dev-tools/packaging/templates/docker/Dockerfile.elastic-agent.tmpl @@ -23,7 +23,7 @@ RUN mkdir -p {{ $beatHome }}/data {{ $beatHome }}/data/elastic-agent-{{ commit_s {{- range $i, $modulesd := .ModulesDirs }} chmod 0775 {{ $beatHome}}/{{ $modulesd }} && \ {{- end }} -{{- if (and (eq .Variant "cloud") (not (contains .from "ubi-minimal"))) }} +{{- if contains .from "-cloud" }} tar -xvf {{ $beatHome }}/data/elastic-agent-*/downloads/metricbeat-*.tar.gz --strip-components 1 --directory /opt --wildcards "*metricbeat" --directory && \ tar -xvf {{ $beatHome }}/data/elastic-agent-*/downloads/filebeat-*.tar.gz --strip-components 1 --directory /opt --wildcards "*filebeat" --directory && \ {{- end }} @@ -138,7 +138,7 @@ RUN mkdir /licenses COPY --from=home {{ $beatHome }}/LICENSE.txt /licenses COPY --from=home {{ $beatHome }}/NOTICE.txt /licenses -{{- if (and (eq .Variant "cloud") (not (contains .from "ubi-minimal"))) }} +{{- if contains .from "-cloud" }} COPY --from=home /opt/filebeat /opt/filebeat COPY --from=home /opt/metricbeat /opt/metricbeat {{- end }}