-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Backport of env2yaml arm64 Docker build context fixes #16063
base: 7.17
Are you sure you want to change the base?
Conversation
docker/templates/Dockerfile.j2
Outdated
COPY env2yaml/env2yaml-amd64 env2yaml/ | ||
COPY env2yaml/env2yaml-arm64 env2yaml/ | ||
|
||
RUN env2yamlarch="$(arch)"; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should address the comment made here docker-library/official-images#16520 (comment), to use the pkg manager to get the architecture.
Ready for another round - buildkite exhaustive tests are failing before they reach the Docker tests, unfortunately |
I kicked off exhaustive tests here: https://buildkite.com/elastic/logstash-exhaustive-tests-pipeline/builds/396 |
@robbavey looks like we're hitting issues with j2 templating:
|
docker/templates/Dockerfile.j2
Outdated
@@ -16,13 +16,15 @@ | |||
{% if image_flavor == 'ubi8' -%} | |||
{% set base_image = 'docker.elastic.co/ubi8/ubi-minimal' -%} | |||
{% set package_manager = 'microdnf' -%} | |||
{% arch_command = 'uname -m' -%} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're missing a set here?
{% arch_command = 'uname -m' -%} | |
{% set arch_command = 'uname -m' -%} |
docker/templates/Dockerfile.j2
Outdated
# Minimal distributions do not ship with en language packs. | ||
{% set locale = 'C.UTF-8' -%} | ||
{% elif image_flavor == 'ironbank' -%} | ||
{% set package_manager = 'yum' -%} | ||
{% else -%} | ||
{% set base_image = 'ubuntu:20.04' -%} | ||
{% set package_manager = 'apt-get' -%} | ||
{% arch_command = 'dpkg --print-architecture' -%} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same:
{% arch_command = 'dpkg --print-architecture' -%} | |
{% set arch_command = 'dpkg --print-architecture' -%} |
This commit contains fixes made to the main 8.x branch to generate arm64 and amd64 env2yaml binaries, copy them into the build context and correctly identify the correct binary in the Dockerfile to include in the Docker image. A clean backport was not available due to the change in format of Dockerfile template from j2 to erb in elastic#15142 This contains fixes from elastic#15980 and elastic#16053.
Use `dpkg --print-architecture` Combine COPY commands to reduce layers
ae312b2
to
3c9679d
Compare
💚 Build Succeeded
History
|
# Copy over the appropriate env2yaml artifact | ||
COPY env2yaml/env2yaml-amd64 env2yaml/env2yaml-arm64 env2yaml/ | ||
|
||
RUN env2yamlarch="$({{ arch_command }})"; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you've got the hood open, I'd also suggest set -eux
here (at the very least set -e
so failures propagate correctly):
RUN env2yamlarch="$({{ arch_command }})"; \ | |
RUN set -eux; \ | |
env2yamlarch="$({{ arch_command }})"; \ |
This commit contains fixes made to the main 8.x branch to generate arm64 and amd64 env2yaml binaries, copy them into the build context and correctly identify the correct binary in the Dockerfile to include in the Docker image.
A clean backport was not available due to the change in format of Dockerfile template from j2 to erb in #15142
This contains fixes from #15980 and #16053.
Release notes
What does this PR do?
Why is it important/What is the impact to the user?
Checklist
Author's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs