diff --git a/docker/templates/Dockerfile.erb b/docker/templates/Dockerfile.erb index 3aa0deec452..26a7f036181 100644 --- a/docker/templates/Dockerfile.erb +++ b/docker/templates/Dockerfile.erb @@ -148,12 +148,26 @@ COPY config/pipelines.yml config/pipelines.yml COPY config/log4j2.properties config/ COPY config/log4j2.file.properties config/ COPY pipeline/default.conf pipeline/logstash.conf +COPY env2yaml/env2yaml-amd64 env2yaml/ +COPY env2yaml/env2yaml-arm64 env2yaml/ + RUN chown --recursive logstash:root config/ pipeline/ # Ensure Logstash gets the correct locale by default. ENV LANG=<%= locale %> LC_ALL=<%= locale %> + # Copy over the appropriate env2yaml artifact -ARG TARGETARCH -COPY env2yaml/env2yaml-${TARGETARCH} /usr/local/bin/env2yaml +RUN env2yamlarch="$(arch)"; \ + case "${env2yamlarch}" in \ + 'x86_64') \ + env2yamlarch=amd64; \ + ;; \ + 'aarch64') \ + env2yamlarch=arm64; \ + ;; \ + *) echo >&2 "error: unsupported architecture '$env2yamlarch'"; exit 1 ;; \ + esac; \ + cp env2yaml/env2yaml-${env2yamlarch} /usr/local/bin/env2yaml; \ + rm -rf env2yaml # Place the startup wrapper script. COPY bin/docker-entrypoint /usr/local/bin/