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

Add custom build flags to docker #923

Closed
wants to merge 1 commit into from
Closed

Conversation

simonoff
Copy link

@simonoff simonoff commented Aug 9, 2022

Signed-off-by: Oleksandr Simonov [email protected]

The reason for this change is because i have this function depends on a private pypi repository on github which requires a providing ssh key inside Dockerfile. To avoid put sensitive data into the images, i decided to make this change to take the benifit of using docker buildkit secrets and ssh support.

Description

In our work we required to have ability to fetch a private libraries for Python through GitHub repo.
I have made a research and have found that there are already a discussion #785 and PR #786. But PR is too specific and in discussion a proposal for more generic variant. So I have added ability to provide a custom arguments to docker build like --ssh or --secret

Example usage for now is next:

faas-cli build --build-flags "--ssh default"

Motivation and Context

Provide ability to fetch from any secure package storage from any git repository or through secrets to fetch from any private package manager's host.

How Has This Been Tested?

Yes, i have added new tests for such feature.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Signed-off-by: Oleksandr Simonov <[email protected]>
@derek derek bot added the new-contributor label Aug 9, 2022
@simonoff
Copy link
Author

simonoff commented Oct 7, 2022

@carlosedp @gliptak @johnmccabe @leodido anyone can take a look on PR?

@carlosedp
Copy link
Contributor

carlosedp commented Oct 7, 2022

I like the idea of getting all build parameter together into the BuildImageConfig type. Also the ability to have flexible build flags suits some use cases mentioned in the linked issues.

/LGTM

@alexellis
Copy link
Member

@simonoff this is with our team for consideration. Thanks again for your interest in OpenFaaS.

@alexellis alexellis closed this Oct 18, 2022
@alexellis
Copy link
Member

Please see note at: #785 (comment)

Feel free to get in touch for a call, if that's of interest?

@alexellis
Copy link
Member

/lock: resolved

@derek derek bot locked and limited conversation to collaborators Oct 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants