Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Dockerfile to select appropriate architecture on build box #16053

Merged
merged 4 commits into from
Apr 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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