Skip to content

Commit

Permalink
Update Dockerfile to select appropriate architecture on build box (#1…
Browse files Browse the repository at this point in the history
…6053) (#16059)

This commit adds logic to copy the appropriate env2yaml file to the Docker image
* Clean up env2yaml folder

Co-authored-by: João Duarte <[email protected]>
(cherry picked from commit e5b2b3d)

Co-authored-by: Rob Bavey <[email protected]>
  • Loading branch information
github-actions[bot] and robbavey authored Apr 5, 2024
1 parent cc36934 commit 9ad0b7e
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions docker/templates/Dockerfile.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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/

Expand Down

0 comments on commit 9ad0b7e

Please sign in to comment.