-
Notifications
You must be signed in to change notification settings - Fork 321
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
Secrets enable in Docker plugin with support for passing environment variables as secrets #332
base: master
Are you sure you want to change the base?
Conversation
… injecting drone git .netrc file into secrets
… DOCKER_BUILDKIT to 1 when secrets are provided or git_netrc_pass is set to true
👋 Hey there, while I appreciate the pull request, I recommend reading this thread: The netrc file is considered Internal use only and is subject to change. We are working to narrow the use of the netrc file and if we can find a suitable alternative, we may consider removing in the future. If you want to inject git credentials into this plugin it should be done using secrets. In terms of using docker secrets, it might make more sense to model this behavior after |
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.
please remove netrc functionality from this pull request. we should scope this pull request around the use of the --secrets
flag.
…iables as docker secrets into build
@bradrydzewski I have modified code as you suggested. I have also modified my Pull Request description with new changes. Right now this Pull Request doesn't create |
The build is failing on go vet, that doesn't seem expected? @bradrydzewski this looks like something we could use today, can you take another look to help get this merged in? |
Looks like the build container is using go Go Not until go |
I think a more thorough design review is going to be required and I want to be up front that this will take some time. We will assign this to a team member in an upcoming sprint and we will post updates to this thread when we have more details to share. We have a strong commitment to backward compatibility which means once this feature is merged it cannot easily be changed, so we need to make sure we are happy with the design and implementation. |
@bradrydzewski ok, I will wait until one of your teammates will review this PR in next sprint. |
Any luck getting some time to review this PR? |
@alexef it looks like plugin maintainers upgraded plugin test to golang 1.13 |
Looks like this could be closed now that #359 was merged. |
@alexef I'm not working for the company which was requesting this feature. I will contact somebody from them and ask for comment here. |
We will, test out the release https://github.com/drone-plugins/drone-docker/releases/tag/v20.12.0, thats is refered in here. |
PR purpose
This PR is providing three new settings to the plugin:
secrets_from_env
- Pass environment variables as secret file into the buildsecrets
- Provide full secrets paths from local filesystemsecret_separator
- separator between each of thesecrets
variableAlso when any
secrets
orsecrets_from_env
are provided then environment variableDOCKER_BUILDKIT
is set to1
. If nothing is provided then plugin willl not create/change that variable.Warning
Because of urfave/cli library is not able to Slice Flags with different sign than
,
then we have introduced another variable calledsecret_separator
. The content of this variable will be replaced with,
on docker build command creation.Example usage
.drone.yml
:Dockerfile
:Other work to do
This PR requires update to drone docker plugin documentation