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

Support building Iron Bank Docker context #64336

Merged
merged 39 commits into from
Nov 16, 2020

Conversation

pugnascotia
Copy link
Contributor

This PR adds support for building a Docker context for Iron Bank. It doesn't actually build the image - we could add that at a later stage, but this is an attempt to automate at least some of the process.

Iron Bank is a lot like our UBI build, except it uses a hardened version of the full UBI image, not the minimal UBI image. They have particular requirements around how the Docker context should be arranged. The Docker build cannot fetch its own artefacts, but instead the context provides a descriptor that locates what is needed for the build.

I also added a filter so that after performing expansions on the Dockerfile, we squash long runs on newlines together. This makes the output cleaner, while allowing us to break up the unprocessed Dockerfile for clarity.

@pugnascotia pugnascotia added >feature >non-issue :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts v8.0.0 v7.11.0 labels Oct 29, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Packaging)

@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Oct 29, 2020
Copy link
Contributor

@mark-vieira mark-vieira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of comments but otherwise LGTM.

distribution/docker/build.gradle Outdated Show resolved Hide resolved
distribution/docker/build.gradle Show resolved Hide resolved
distribution/docker/build.gradle Outdated Show resolved Hide resolved
@@ -324,6 +362,8 @@ subprojects { Project subProject ->

final Architecture architecture = subProject.name.contains('aarch64-') ? Architecture.AARCH64 : Architecture.X64
final boolean oss = subProject.name.contains('oss-')
// We can ignore Iron Bank at the moment as we don't
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just so I understand, we are effectively not building the iron bank image here becuase we have not added a corresponding "export' project for it, yes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, there's no export task, and there won't be without a way to automatically build the image. That would require simulating the Iron Bank image build process.

distribution/docker/ubi-docker-build-context/build.gradle Outdated Show resolved Hide resolved
@nkammah
Copy link
Contributor

nkammah commented Nov 6, 2020

When you have a chance, would you be able to upload a copy of the artifacts generated by the new ironbank target ?

As for the "" placeholder, without knowing more what the future automation will look like, i'm ok with this approach. Keeping a blank value "" would be probably easier to standardize, but it's not as explicit as your current value.

@mark-vieira mark-vieira added Team:Delivery Meta label for Delivery team and removed Team:Core/Infra Meta label for core/infra team labels Nov 11, 2020
@pugnascotia pugnascotia merged commit e07adb7 into elastic:master Nov 16, 2020
@pugnascotia pugnascotia deleted the support-ubi-iron-bank branch November 16, 2020 12:21
pugnascotia added a commit to pugnascotia/elasticsearch that referenced this pull request Nov 16, 2020
This PR adds support for building a Docker context for Iron Bank.
It doesn't actually build the image - we could add that at a later
stage, but this is an attempt to automate at least some of the
process.

Iron Bank is a lot like our UBI build, except it uses a hardened
version of the full UBI image, not the minimal UBI image. They have
particular requirements around how the Docker context should be
arranged. The Docker build cannot fetch its own artefacts, but
instead the context provides a descriptor that locates what is
needed for the build.

I also added a filter so that after performing expansions on the
`Dockerfile`, we squash long runs on newlines together. This makes
the output cleaner, while allowing us to break up the unprocessed
`Dockerfile` for clarity.
pugnascotia added a commit that referenced this pull request Nov 16, 2020
Backport of #64336.

This PR adds support for building a Docker context for Iron Bank.
It doesn't actually build the image - we could add that at a later
stage, but this is an attempt to automate at least some of the
process.

Iron Bank is a lot like our UBI build, except it uses a hardened
version of the full UBI image, not the minimal UBI image. They have
particular requirements around how the Docker context should be
arranged. The Docker build cannot fetch its own artefacts, but
instead the context provides a descriptor that locates what is
needed for the build.

I also added a filter so that after performing expansions on the
`Dockerfile`, we squash long runs on newlines together. This makes
the output cleaner, while allowing us to break up the unprocessed
`Dockerfile` for clarity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts >feature >non-issue Team:Delivery Meta label for Delivery team v7.11.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants