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 buildkit flags #1769

Closed
carolynvs opened this issue Sep 21, 2021 · 2 comments
Closed

Support buildkit flags #1769

carolynvs opened this issue Sep 21, 2021 · 2 comments
Assignees
Labels
2 - 🍕 Pizza should be eaten daily gap We missed a spot security 🔒 Security issues, bugs and features
Milestone

Comments

@carolynvs
Copy link
Member

When I added buildkit support, I didn't expose all the necessary flags that docker build has so that the user can pass in information to the build during porter build that buildkit supports. When we build a bundle that uses buildkit in the template, we should support passing in extra arguments such as ssh, mounts and secrets.

https://github.com/moby/buildkit/blob/master/frontend/dockerfile/docs/syntax.md

porter build --ssh default=$SSH_AUTH_SOCK
porter build --secret id=aws,src=$HOME/.aws/credentials
porter build --build-arg VERSION=1.2.3

The scenarios we want to support are:

  • Run a command when building the invocation image inside a private repository that we don't want included in the final image. The user should have already checked out the repository into the bundle directory.
  • Pull a private helm chart secured by a secret that is passed into porter build
  • Specify a variable, like the application version, during build and use it.
@carolynvs carolynvs added gap We missed a spot 2 - 🍕 Pizza should be eaten daily labels Sep 21, 2021
@carolynvs carolynvs added this to the 1.0 milestone Sep 21, 2021
@carolynvs
Copy link
Member Author

From @MChorfa

https://www.youtube.com/watch?v=0iN4dJB3OLk

buildx is a Docker CLI plugin for extended build capabilities with BuildKit.
https://github.com/docker/buildx

BuildKit is a toolkit for converting source code to build artifacts in an efficient, expressive and repeatable manner.
https://github.com/moby/buildkit

xx - Dockerfile cross-compilation helpers
https://github.com/tonistiigi/xx

Cross-platform emulator collection distributed with Docker images.
https://github.com/tonistiigi/binfmt

@carolynvs carolynvs added the security 🔒 Security issues, bugs and features label Nov 18, 2021
@carolynvs carolynvs self-assigned this Mar 31, 2022
carolynvs added a commit to carolynvs/porter that referenced this issue Apr 1, 2022
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

Closes getporter#1769

Signed-off-by: Carolyn Van Slyck <[email protected]>
carolynvs added a commit to carolynvs/porter that referenced this issue Apr 1, 2022
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

Closes getporter#1769

Signed-off-by: Carolyn Van Slyck <[email protected]>
carolynvs added a commit to carolynvs/porter that referenced this issue Apr 1, 2022
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]>
carolynvs added a commit to carolynvs/porter that referenced this issue Apr 1, 2022
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]>
carolynvs added a commit to carolynvs/porter that referenced this issue Apr 4, 2022
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]>
carolynvs added a commit to carolynvs/porter that referenced this issue Apr 4, 2022
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]>
carolynvs added a commit that referenced this issue Apr 5, 2022
…#1999)

* Support additional docker build 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.

Closes #1769
Closes #1941

Signed-off-by: Carolyn Van Slyck <[email protected]>

* 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

Closes #1954

Signed-off-by: Carolyn Van Slyck <[email protected]>

* Default dockerfile syntax to 1.4.0

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]>

* Code cleanup

Signed-off-by: Carolyn Van Slyck <[email protected]>

* Document new ShouldLog function

Signed-off-by: Carolyn Van Slyck <[email protected]>
@github-actions github-actions bot closed this as completed Apr 5, 2022
@github-actions
Copy link

github-actions bot commented Apr 5, 2022

Closed by #1999.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 - 🍕 Pizza should be eaten daily gap We missed a spot security 🔒 Security issues, bugs and features
Projects
None yet
Development

No branches or pull requests

1 participant