-
Notifications
You must be signed in to change notification settings - Fork 693
Conversation
This allows using workspace status information (such as git describe) in image tags.
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.
Very cool, thanks!
Can you update the usage in the README.md as well?
docker/join_layers.py
Outdated
with open(infofile) as info: | ||
for line in info: | ||
line = line.strip("\n") | ||
key, value = line.split(" ") |
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.
you probably want line.split(" ", 1)
(or maybe 2, I can never remember the sense of this)
docker/join_layers.py
Outdated
for line in info: | ||
line = line.strip("\n") | ||
key, value = line.split(" ") | ||
stamp_info[key] = value |
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.
Can you print a warning when key
exists in the map?
f159d08
to
8f590ca
Compare
8f590ca
to
728572f
Compare
Thanks for the quick review! I've addressed your comments in a follow-up commit and can squash if desired. |
GitHub will let me squash and merge, but I'm happy to leave the history there. thanks for the change. |
This allows using workspace status information (such as git describe) in image tags. To differentiate from make variables (and laziness), I'm using python formatting syntax, e.g.
{STABLE_BUILD_USER}
or{MY_CUSTOM_VAR}
.This is basically an implementation of what I was describing in #3 (comment).
I think it'd work for what I need for kubernetes right now, though I'm not sure if this is the correct implementation, e.g. does it makes sense to do the stamping in
docker_bundle
? Should it also be supported indocker_build
and/ordocker_push
? What things should be "stampable"? Do we want to be able to embed stamping info in image labels? (I might in the future, e.g. embed revision/other build data.)(
docker_push
actually looks harder, since it's basically just a shell script template wrapper to the code in containerregistry.)The proper way to do all of this would be entirely in skylark, though that depends on bazelbuild/bazel#1054 being resolved.