mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
* Add arm64 support for env2yaml
This commit builds env2yaml in arm64 and amd64 flavors, and uses
$TARGETARCH in the Dockerfile to ensure that the correct version is used
when building for alternative architectures
Fixes: #15913
* Add env2yaml executables to build context
* Split `COPY_FILES` for readability
Co-authored-by: Andrea Selva <selva.andre@gmail.com>
---------
Co-authored-by: Andrea Selva <selva.andre@gmail.com>
(cherry picked from commit b640e7e851
)
Co-authored-by: Rob Bavey <rob.bavey@elastic.co>
This commit is contained in:
parent
0c30b6be37
commit
b565864f4f
2 changed files with 16 additions and 5 deletions
|
@ -56,7 +56,9 @@ build-from-local-ubi8-artifacts: dockerfile env2yaml
|
|||
|
||||
COPY_FILES := $(ARTIFACTS_DIR)/docker/config/pipelines.yml $(ARTIFACTS_DIR)/docker/config/logstash-oss.yml $(ARTIFACTS_DIR)/docker/config/logstash-full.yml
|
||||
COPY_FILES += $(ARTIFACTS_DIR)/docker/config/log4j2.file.properties $(ARTIFACTS_DIR)/docker/config/log4j2.properties
|
||||
COPY_FILES += $(ARTIFACTS_DIR)/docker/pipeline/default.conf $(ARTIFACTS_DIR)/docker/bin/docker-entrypoint $(ARTIFACTS_DIR)/docker/env2yaml/env2yaml
|
||||
COPY_FILES += $(ARTIFACTS_DIR)/docker/pipeline/default.conf $(ARTIFACTS_DIR)/docker/bin/docker-entrypoint
|
||||
COPY_FILES += $(ARTIFACTS_DIR)/docker/env2yaml/env2yaml-arm64
|
||||
COPY_FILES += $(ARTIFACTS_DIR)/docker/env2yaml/env2yaml-amd64
|
||||
|
||||
$(ARTIFACTS_DIR)/docker/config/pipelines.yml: data/logstash/config/pipelines.yml
|
||||
$(ARTIFACTS_DIR)/docker/config/logstash-oss.yml: data/logstash/config/logstash-oss.yml
|
||||
|
@ -65,7 +67,8 @@ $(ARTIFACTS_DIR)/docker/config/log4j2.file.properties: data/logstash/config/log4
|
|||
$(ARTIFACTS_DIR)/docker/config/log4j2.properties: data/logstash/config/log4j2.properties
|
||||
$(ARTIFACTS_DIR)/docker/pipeline/default.conf: data/logstash/pipeline/default.conf
|
||||
$(ARTIFACTS_DIR)/docker/bin/docker-entrypoint: data/logstash/bin/docker-entrypoint
|
||||
$(ARTIFACTS_DIR)/docker/env2yaml/env2yaml: data/logstash/env2yaml/env2yaml
|
||||
$(ARTIFACTS_DIR)/docker/env2yaml/env2yaml-arm64: data/logstash/env2yaml/env2yaml-arm64
|
||||
$(ARTIFACTS_DIR)/docker/env2yaml/env2yaml-amd64: data/logstash/env2yaml/env2yaml-amd64
|
||||
|
||||
$(ARTIFACTS_DIR)/docker/%:
|
||||
cp -f $< $@
|
||||
|
@ -184,7 +187,12 @@ push:
|
|||
env2yaml:
|
||||
docker run --rm \
|
||||
-v "$(PWD)/data/logstash/env2yaml:/usr/src/env2yaml" \
|
||||
-w /usr/src/env2yaml golang:1 go build
|
||||
-e GOARCH=arm64 -e GOOS=linux \
|
||||
-w /usr/src/env2yaml golang:1 go build -o /usr/src/env2yaml/env2yaml-arm64
|
||||
docker run --rm \
|
||||
-v "$(PWD)/data/logstash/env2yaml:/usr/src/env2yaml" \
|
||||
-e GOARCH=amd64 -e GOOS=linux \
|
||||
-w /usr/src/env2yaml golang:1 go build -o /usr/src/env2yaml/env2yaml-amd64
|
||||
|
||||
# Generate the Dockerfiles from ERB templates.
|
||||
dockerfile: templates/Dockerfile.erb
|
||||
|
@ -200,6 +208,7 @@ dockerfile: templates/Dockerfile.erb
|
|||
)
|
||||
|
||||
clean:
|
||||
rm -f ${ARTIFACTS_DIR}/env2yaml/env2yaml ${ARTIFACTS_DIR}/Dockerfile
|
||||
rm -f ${ARTIFACTS_DIR}/env2yaml/env2yaml-* ${ARTIFACTS_DIR}/Dockerfile
|
||||
|
||||
|
||||
.PHONY: clean push
|
||||
|
|
|
@ -147,7 +147,9 @@ COPY pipeline/default.conf pipeline/logstash.conf
|
|||
RUN chown --recursive logstash:root config/ pipeline/
|
||||
# Ensure Logstash gets the correct locale by default.
|
||||
ENV LANG=<%= locale %> LC_ALL=<%= locale %>
|
||||
COPY env2yaml/env2yaml /usr/local/bin/
|
||||
# Copy over the appropriate env2yaml artifact
|
||||
ARG TARGETARCH
|
||||
COPY env2yaml/env2yaml-${TARGETARCH} /usr/local/bin/env2yaml
|
||||
# Place the startup wrapper script.
|
||||
COPY bin/docker-entrypoint /usr/local/bin/
|
||||
<% else -%>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue