faas-cli icon indicating copy to clipboard operation
faas-cli copied to clipboard

Add custom build flags to docker

Open simonoff opened this issue 3 years ago • 0 comments

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)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

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

simonoff avatar Aug 09 '22 16:08 simonoff