Skip to content

Passwd build rule prototype - #16

Closed
dlorenc wants to merge 1 commit into
GoogleContainerTools:masterfrom
dlorenc:passwd2
Closed

Passwd build rule prototype#16
dlorenc wants to merge 1 commit into
GoogleContainerTools:masterfrom
dlorenc:passwd2

Conversation

@dlorenc

@dlorenc dlorenc commented May 12, 2017

Copy link
Copy Markdown
Contributor

Here's a quick version of what we discussed in #14

Comment thread tools/BUILD
@@ -0,0 +1,6 @@
load(":passwd.bzl", "passwd_file")

passwd_file(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove this, it was just for testing.

Comment thread tools/passwd.bzl
arg_file = ctx.new_file(ctx.attr.name + ".args")
ctx.file_action(arg_file, "\n".join(args))

ctx.action(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@damienmg What's the best way to send this through pkg_tar

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the best way, we could make it 2 rules instead of one and do the second action with pkg_tar, but why?

Comment thread tools/passwd.bzl
@@ -0,0 +1,56 @@
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tl;dr I think we should add this to bazelbuild/rules_docker.

Perhaps under docker/contrib for now. It should be very straightforward to add a rule that uses it under docker/testdata and verifies the result under docker/build_test.sh.

WDYT?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds reasonable to me, this is the kind of utility that people would want to have.

Also as discussed on our CI, it would be good to have a list of example / good base images for dockerless build

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM. I'll move it over there with a test, then add it to our base here.

@dlorenc

dlorenc commented May 15, 2017

Copy link
Copy Markdown
Contributor Author

Closing, this was merged upstream.

@dlorenc dlorenc closed this May 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants