-
Notifications
You must be signed in to change notification settings - Fork 212
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 additional docker flags and remove legacy docker build driver #1999
Conversation
ad3c275
to
88cbf88
Compare
/azp run porter-integration |
Azure Pipelines successfully started running 1 pipeline(s). |
f8317c1
to
910e3a1
Compare
/azp run porter-integration |
Azure Pipelines successfully started running 1 pipeline(s). |
910e3a1
to
04f099f
Compare
/azp run porter-integration |
Pull request contains merge conflicts. |
04f099f
to
d3a45c9
Compare
/azp run porter-integration |
Azure Pipelines successfully started running 1 pipeline(s). |
This adds support for the following docker flags: --build-arg: Pass build arguments that can be used in the template dockerfile --ssh: Provide a ssh configuration to the container while building --secret: Provide a secret to the container while building --no-cache: Build the image and do not use cached layers. It also fixes how we call the docker buildx plugin so that user configuration, such as a proxy, is used. After upgrading to a new version of buildx, I was also able to pick up a fix for pretty printing the progress to stderr, while capturing the plaintext output to the logs. Closes getporter#1769 Closes getporter#1941 Signed-off-by: Carolyn Van Slyck <[email protected]>
Default to buildkit only and remove the docker build driver Keep the build driver config option, in case we ever get creative in the future Closes getporter#1954 Signed-off-by: Carolyn Van Slyck <[email protected]>
If a template that was previously written for legacy docker is used now that we only support buildkit, use dockerfile syntax 1.4.0 and prepend that to their template so that when we inject things like `COPY --link` their bundle still builds. Signed-off-by: Carolyn Van Slyck <[email protected]>
d3a45c9
to
f1912a1
Compare
/azp run porter-integration |
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Carolyn Van Slyck <[email protected]>
Signed-off-by: Carolyn Van Slyck <[email protected]>
/azp run porter-integration |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
So much goodness in this one! The added example is great as well. LGTM.
@vdice The example sort of snuck in 😂 It's going to be the source for an upcoming blog post telling people about the new buildkit features. I'll add a follow-up to make it a proper example linked from our examples page too though! https://release-v1.porter.sh/examples. |
What does this change
Support additional docker flags
This adds support for the following docker flags:
--build-arg: Pass build arguments that can be used in the template dockerfile
--ssh: Provide a ssh configuration to the container while building
--secret: Provide a secret to the container while building
--no-cache: Build the image and do not use cached layers.
It also fixes how we call the docker buildx plugin so that user configuration, such as a proxy, is used.
After upgrading to a new version of buildx, I was also able to pick up a fix for pretty printing the progress to stderr, while capturing the plaintext output to the logs.
The dockerfile syntax 1.4.0 is officially released, so I've also edited our templates to use the official version
# syntax=docker/dockerfile-upstream:1.4.0
Remove experimental flag for build drivers
Default to buildkit only and remove the docker build driver. Keep the build driver config option, in case we ever get creative in the future
What issue does it fix
Closes #1769 (support new buildkit flags)
Closes #1954 (make buildkit the default driver and get rid of legacy docker)
Closes #1941 (load docker config)
Notes for the reviewer
🚨 This must be rebased before merging, it relies on #1998I kept the configuration infra in place in case we ever add a new build driver in the future. But the flag --driver is now hidden for the build command since there's no reason to set it at the moment. I also kept the experimental config documentation and just let people know it's not needed anymore. I felt that people who were used to the flag would be confused to have its doc disappear without explanation.
Long term maybe we need a page/section of "promoted" experimental features.
Checklist
Reviewer Checklist